public static function display($menuClasses = null) { $id = 'MenuUtils_display' . Invocation::next(); $jsLibraries = JS::libraryWithDependancies(JS::JQUERY_UI); $activeMenu = Request::get(self::ACTIVE_MENU, 0); $js = <<<JS \$().ready ( function () { \$( '#{$id}' ).show() .accordion({ collapsible: true, active: {$activeMenu} }); }); JS; $html = ''; $html .= Tag::div(['id' => $id, 'style' => 'font-size: 0.8em; width:250px; text-align:left; display:none;']); foreach (self::getMenuItems($menuClasses) as $header => $menuList) { $html .= Tag::hTag('h3') . Tag::hRef('#', $header) . Tag::_hTag('h3') . Tag::div() . Tag::ul(); foreach ($menuList as $row) { $html .= Tag::li(); if (isset($row['slug'])) { $html .= Tag::hRef(Cfg::siteUrl() . '/menu.php?S=' . $row['slug'], $row['name'], $row['attribs']); } else { $html .= Tag::hRef($row['url'], $row['name'], $row['attribs']); } $html .= Tag::_li(); } $html .= Tag::_ul() . Tag::_div(); } $html .= Tag::_div(); return $jsLibraries . JS::javaScript($js) . $html; }
public static function menu() { if (Privileges::access(__METHOD__) !== true || !G::isLoggedIn()) { return ''; } $resp = new Response(); $html = Tag::hTag('b') . 'Super Admin Menu' . Tag::_hTag('b') . Tag::ul(['id' => 'menuList']); foreach (self::getMenu() as $title => $action) { $html .= Tag::li() . Tag::hRef('?' . $resp->action($action)->toUrl(), $title) . Tag::_li(); } $html .= Tag::_ul(); return $html; }
private function loginForm() { $jsUrl = Cfg::get('js_url'); $jQuery = <<<JS \$().ready(function() { \$('#hoverimage').hover ( function () { \$('#extralinks').fadeIn('fast'); }, function () { setTimeout("\$('#extralinks').fadeOut();", 3000 ); }); \$('a.facebox').facebox({closeImage: '{$jsUrl}/images/closelabel.png', loadingImage: '{$jsUrl}/images/loading.gif' }); }); JS; $formName = 'FancyLogin_loginForm'; $valid = Validator::factory($formName, 'LF')->addExists(self::LOGIN_FNAME, 'Email field must not be empty')->addExists(self::PASSW_FNAME, 'Password field must not be empty'); $resp = new Response(); $html = JS::library(JS::JQUERY) . JS::libraryWithDependancies(JS::FACEBOX) . JS::javaScript($jQuery) . Tag::table() . Tag::tr() . Tag::td(['id' => 'hoverimage', 'class' => 'login', 'nowrap' => 'nowrap']) . $valid->toHtml() . Tag::form(['id' => $formName, 'name' => $formName, 'onSubmit' => $valid->onSubmit()]) . $resp->set(self::ACTION, __CLASS__ . '->checkLogin()')->toHidden() . Tag::table() . Tag::tr() . Tag::td() . 'Email' . Tag::_td() . Tag::td() . Tag::text(self::LOGIN_FNAME, ['size' => 10, 'style' => 'opacity:0.5;filter:alpha(opacity=50)']) . Tag::_td() . Tag::td() . 'Password:'******'size' => 10, 'style' => 'opacity:0.5;filter:alpha(opacity=50)']) . Tag::_td() . Tag::td() . Tag::submit('Go') . Tag::_td() . Tag::_tr() . Tag::_table() . Tag::_form() . Tag::_td() . Tag::_tr() . Tag::tr() . Tag::td(['id' => 'extralinks', 'style' => 'display: none;']) . Tag::ul(['id' => 'vertMenu']); if (Cfg::get('jb_self_register', false)) { $html .= Tag::li() . Tag::hRef('ajax.php?' . $resp->action(__CLASS__ . '->newRegistration()')->toUrl(), 'Register New Account', ['class' => 'facebox']) . Tag::_li(); } $html .= Tag::li() . Tag::hRef('ajax.php?' . $resp->action(__CLASS__ . '->forgotPassword()')->toUrl(), 'Forgot My Password', ['class' => 'facebox']) . Tag::_li() . Tag::_ul() . Tag::_td() . Tag::_tr() . Tag::_table(); return $html; }
public function index() { $sitePath = Cfg::get('site_path'); $sitePathLen = strlen($sitePath); $resp = Response::factory()->action(__CLASS__ . '->zoom()'); $html = Tag::ul(); foreach ($this->findImages($sitePath) as $item) { $relItemName = substr($item, $sitePathLen); $html .= Tag::li() . Tag::hRef('?' . $resp->set('url', $relItemName)->toUrl(), $relItemName) . Tag::_li(); } $html .= Tag::_ul(); return $html; }