本文整理汇总了PHP中MenusHelper::getMenuTypeList方法的典型用法代码示例。如果您正苦于以下问题:PHP MenusHelper::getMenuTypeList方法的具体用法?PHP MenusHelper::getMenuTypeList怎么用?PHP MenusHelper::getMenuTypeList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenusHelper
的用法示例。
在下文中一共展示了MenusHelper::getMenuTypeList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: type
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: getPagination
/**
* 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: array
/**
*
* 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: ajaxShowSaveForm
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();
}