From a1c79f76960416d9cb930433e1b53320ced84abb Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 19 Jan 2010 18:21:47 -0700 Subject: [PATCH] Move main.php to index.php --- jeta/index.php | 14 +++++++++++++- jeta/lib/Jeta.php | 10 ++++------ jeta/main.php | 23 ----------------------- 3 files changed, 17 insertions(+), 30 deletions(-) delete mode 100644 jeta/main.php diff --git a/jeta/index.php b/jeta/index.php index 8d497e307..956b01c80 100644 --- a/jeta/index.php +++ b/jeta/index.php @@ -8,4 +8,16 @@ * @author Eric Rostetter */ -require dirname(__FILE__) . '/main.php'; +require_once dirname(__FILE__) . '/lib/Application.php'; +Horde_Registry::appInit('jeta'); + +$applet = Jeta_Applet::factory($prefs->getValue('sshdriver')); + +$template = new Horde_Template(); +$template->set('menu', Jeta::getMenu()->render()); +$template->set('notification', $notification->notify(array('listeners' => 'status'))); +$template->set('applet', $applet->generateAppletCode()); + +require JETA_TEMPLATES . '/common-header.inc'; +echo $template->fetch(JETA_TEMPLATES . '/main.html'); +require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/jeta/lib/Jeta.php b/jeta/lib/Jeta.php index 390031562..daf9c9bb3 100644 --- a/jeta/lib/Jeta.php +++ b/jeta/lib/Jeta.php @@ -8,19 +8,17 @@ * @author Michael Slusarz * @package Jeta */ -class Jeta { - +class Jeta +{ /** * Build Jeta's list of menu items. */ - function getMenu() + public function getMenu() { - global $registry, $conf; - $menu = new Horde_Menu(); /* Jeta Home. */ - $menu->addArray(array('url' => Horde::applicationUrl('main.php'), 'text' => _("_Shell"), 'icon' => 'jeta.png', 'class' => (basename($_SERVER['PHP_SELF']) == 'main.php' || basename($_SERVER['PHP_SELF']) == 'index.php') ? 'current' : '')); + $menu->addArray(array('url' => Horde::applicationUrl('index.php'), 'text' => _("_Shell"), 'icon' => 'jeta.png', 'class' => (basename($_SERVER['PHP_SELF']) == 'index.php') ? 'current' : '')); return $menu; } diff --git a/jeta/main.php b/jeta/main.php deleted file mode 100644 index 956b01c80..000000000 --- a/jeta/main.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ - -require_once dirname(__FILE__) . '/lib/Application.php'; -Horde_Registry::appInit('jeta'); - -$applet = Jeta_Applet::factory($prefs->getValue('sshdriver')); - -$template = new Horde_Template(); -$template->set('menu', Jeta::getMenu()->render()); -$template->set('notification', $notification->notify(array('listeners' => 'status'))); -$template->set('applet', $applet->generateAppletCode()); - -require JETA_TEMPLATES . '/common-header.inc'; -echo $template->fetch(JETA_TEMPLATES . '/main.html'); -require $registry->get('templates', 'horde') . '/common-footer.inc'; -- 2.11.0