コード例 #1
0
ファイル: view.php プロジェクト: Fellah/govnobaki
 function type($tpl = null)
 {
     JRequest::setVar('hidemainmenu', 1);
     global $mainframe;
     $lang =& JFactory::getLanguage();
     $this->_layout = 'type';
     $item =& $this->get('Item');
     // Set toolbar items for the page
     if (!$item->id) {
         JToolBarHelper::title(JText::_('Menu Item') . ': <small><small>[ ' . JText::_('New') . ' ]</small></small>', 'menu.png');
     } else {
         JToolBarHelper::title(JText::_('Change Menu Item'), 'menu.png');
     }
     // Set toolbar items for the page
     JToolBarHelper::cancel('view');
     JToolBarHelper::help('screen.menus.type');
     // Add scripts and stylesheets to the document
     $document =& JFactory::getDocument();
     if ($lang->isRTL()) {
         $document->addStyleSheet('components/com_menus/assets/type_rtl.css');
     } else {
         $document->addStyleSheet('components/com_menus/assets/type.css');
     }
     JHTML::_('behavior.tooltip');
     // Load component language files
     $components = MenusHelper::getComponentList();
     $n = count($components);
     for ($i = 0; $i < $n; $i++) {
         $path = JPATH_SITE . DS . 'components' . DS . $components[$i]->option . DS . 'views';
         $components[$i]->legacy = !is_dir($path);
         $lang->load($components[$i]->option, JPATH_ADMINISTRATOR);
     }
     // Initialize variables
     $item =& $this->get('Item');
     $expansion =& $this->get('Expansion');
     $component =& $this->get('Component');
     $name = $this->get('StateName');
     $description = $this->get('StateDescription');
     $menuTypes = MenusHelper::getMenuTypeList();
     // Set document title
     if ($item->id) {
         $document->setTitle(JText::_('Menu Item') . ': [' . JText::_('Edit') . ']');
     } else {
         $document->setTitle(JText::_('Menu Item') . ': [' . JText::_('New') . ']');
     }
     $this->assignRef('item', $item);
     $this->assignRef('components', $components);
     $this->assignRef('expansion', $expansion);
     parent::display($tpl);
 }
コード例 #2
0
ファイル: menutype.php プロジェクト: kaantunc/MYK-BOR
 /**
  * Get a list of the menu records associated with the type
  *
  * @param string The menu type
  * @return array An array of records as objects
  */
 function getPagination()
 {
     global $mainframe;
     $menutypes = MenusHelper::getMenuTypeList();
     $total = count($menutypes);
     $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
     $limitstart = $mainframe->getUserStateFromRequest('com_menus.limitstart', 'limitstart', 0, 'int');
     jimport('joomla.html.pagination');
     $pagination = new JPagination($total, $limitstart, $limit);
     return $pagination;
 }
コード例 #3
0
ファイル: XmapAdmin.php プロジェクト: omarmm/MangLuoiBDS
 /** 
  * 
  * get the complete list of menus in joomla 
  */
 function &getMenus()
 {
     $config =& $this->config;
     require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_menus' . DS . 'helpers' . DS . 'helper.php';
     $menutypes = MenusHelper::getMenuTypeList();
     $allmenus = array();
     $i = 0;
     foreach ($menutypes as $menu) {
         $menutype = $menu->menutype;
         $allmenus[$menutype] = new stdclass();
         $allmenus[$menutype]->ordering = $i;
         $allmenus[$menutype]->show = false;
         $allmenus[$menutype]->showSitemap = false;
         $allmenus[$menutype]->priority = '0.5';
         $allmenus[$menutype]->changefreq = 'weekly';
         $allmenus[$menutype]->id = $i;
         $allmenus[$menutype]->type = $menutype;
         $i++;
     }
     return $allmenus;
 }
コード例 #4
0
ファイル: memberlist.php プロジェクト: bizanto/Hooked
 public function ajaxShowSaveForm()
 {
     CFactory::load('helpers', 'owner');
     require_once JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_menus' . DS . 'helpers' . DS . 'helper.php';
     if (!COwnerHelper::isCommunityAdmin()) {
         echo JText::_('CC RESTRICTED ACCESS');
         return;
     }
     $response = new JAXResponse();
     $args = func_get_args();
     if (!isset($args[0])) {
         $response->addScriptCall('alert', 'CC INVALID ID');
         return $resopnse->sendResponse();
     }
     $condition = $args[0];
     array_shift($args);
     $avatarOnly = $args[0];
     array_shift($args);
     $filters = $args;
     $menuTypes = MenusHelper::getMenuTypeList();
     $menuAccess = new stdClass();
     $menuAccess->access = 0;
     $tmpl = new CTemplate();
     $tmpl->set('condition', $condition);
     $tmpl->set('menuTypes', $menuTypes);
     $tmpl->set('menuAccess', $menuAccess);
     $tmpl->set('avatarOnly', $avatarOnly);
     $tmpl->set('filters', $filters);
     $html = $tmpl->fetch('ajax.memberlistform');
     $response->addAssign('cwin_logo', 'innerHTML', JText::_('CC SEARCH FILTER'));
     $response->addAssign('cWindowContent', 'innerHTML', $html);
     $action = '<button  class="button" onclick="cWindowHide();">' . JText::_('CC BUTTON CANCEL') . '</button>';
     $action .= '<button  class="button" onclick="joms.memberlist.submit();">' . JText::_('CC BUTTON SAVE') . '</button>';
     $response->addScriptCall('cWindowActions', $action);
     return $response->sendResponse();
 }