當前位置: 首頁>>代碼示例>>PHP>>正文


PHP MenusHelper::Published方法代碼示例

本文整理匯總了PHP中MenusHelper::Published方法的典型用法代碼示例。如果您正苦於以下問題:PHP MenusHelper::Published方法的具體用法?PHP MenusHelper::Published怎麽用?PHP MenusHelper::Published使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MenusHelper的用法示例。


在下文中一共展示了MenusHelper::Published方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: edit

 function edit($tpl = null)
 {
     JRequest::setVar('hidemainmenu', 1);
     global $mainframe;
     $lang =& JFactory::getLanguage();
     $this->_layout = 'form';
     $item =& $this->get('Item');
     // clean item data
     JFilterOutput::objectHTMLSafe($item, ENT_QUOTES, '');
     // 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::_('Menu Item') . ': <small><small>[ ' . JText::_('Edit') . ' ]</small></small>', 'menu.png');
     }
     JToolBarHelper::save();
     JToolBarHelper::apply();
     if ($item->id) {
         // for existing items the button is renamed `close`
         JToolBarHelper::cancel('cancelItem', 'Close');
     } else {
         JToolBarHelper::cancel('cancelItem');
     }
     JToolBarHelper::help('screen.menus.edit');
     // Load component language files
     $component =& $this->get('Component');
     $lang->load($component->option, JPATH_ADMINISTRATOR);
     // Initialize variables
     $urlparams = $this->get('UrlParams');
     $params = $this->get('StateParams');
     $sysparams = $this->get('SystemParams');
     $advanced = $this->get('AdvancedParams');
     $component = $this->get('ComponentParams');
     $name = $this->get('StateName');
     $description = $this->get('StateDescription');
     $menuTypes = MenusHelper::getMenuTypeList();
     $components = MenusHelper::getComponentList();
     JHTML::_('behavior.tooltip');
     $document =& JFactory::getDocument();
     if ($item->id) {
         $document->setTitle(JText::_('Menu Item') . ': [' . JText::_('Edit') . ']');
     } else {
         $document->setTitle(JText::_('Menu Item') . ': [' . JText::_('New') . ']');
     }
     // Was showing up null in some cases....
     if (!$item->published) {
         $item->published = 0;
     }
     $lists = new stdClass();
     $lists->published = MenusHelper::Published($item);
     $lists->disabled = $item->type != 'url' ? 'readonly="true"' : '';
     $item->expansion = null;
     if ($item->type != 'url') {
         $lists->disabled = 'readonly="true"';
         $item->linkfield = '<input type="hidden" name="link" value="' . $item->link . '" />';
         if ($item->id && $item->type == 'component' && isset($item->linkparts['option'])) {
             $item->expansion = '&amp;expand=' . trim(str_replace('com_', '', $item->linkparts['option']));
         }
     } else {
         $lists->disabled = null;
         $item->linkfield = null;
     }
     $this->assignRef('lists', $lists);
     $this->assignRef('item', $item);
     $this->assignRef('urlparams', $urlparams);
     $this->assignRef('sysparams', $sysparams);
     $this->assignRef('params', $params);
     $this->assignRef('advanced', $advanced);
     $this->assignRef('comp', $component);
     $this->assignRef('menutypes', $menuTypes);
     $this->assignRef('name', $name);
     $this->assignRef('description', $description);
     // Add slider pane
     $pane =& JPane::getInstance('sliders');
     $this->assignRef('pane', $pane);
     parent::display($tpl);
 }
開發者ID:Fellah,項目名稱:govnobaki,代碼行數:77,代碼來源:view.php

示例2: edit

 function edit($tpl = null)
 {
     JRequest::setVar('hidemainmenu', 1);
     global $mainframe;
     $lang =& JFactory::getLanguage();
     $this->_layout = 'form';
     $item =& $this->get('Item');
     // clean item data
     JFilterOutput::objectHTMLSafe($item, ENT_QUOTES, '');
     // 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::_('Menu Item') . ': <small><small>[ ' . JText::_('Edit') . ' ]</small></small>', 'menu.png');
     }
     JToolBarHelper::save();
     JToolBarHelper::apply();
     if ($item->id) {
         // for existing items the button is renamed `close`
         JToolBarHelper::cancel('cancelItem', 'Close');
     } else {
         JToolBarHelper::cancel('cancelItem');
     }
     JToolBarHelper::help('screen.menus.edit');
     // Load component language files
     $component =& $this->get('Component');
     $lang->load($component->option, JPATH_ADMINISTRATOR);
     // Initialize variables
     $urlparams = $this->get('UrlParams');
     $params = $this->get('StateParams');
     $sysparams = $this->get('SystemParams');
     $advanced = $this->get('AdvancedParams');
     $component = $this->get('ComponentParams');
     $name = $this->get('StateName');
     $description = $this->get('StateDescription');
     $menuTypes = MenusHelper::getMenuTypeList();
     $components = MenusHelper::getComponentList();
     JHTML::_('behavior.tooltip');
     $document =& JFactory::getDocument();
     if ($item->id) {
         $document->setTitle(JText::_('Menu Item') . ': [' . JText::_('Edit') . ']');
     } else {
         $document->setTitle(JText::_('Menu Item') . ': [' . JText::_('New') . ']');
     }
     // Was showing up null in some cases....
     if (!$item->published) {
         $item->published = 0;
     }
     $lists = new stdClass();
     $lists->published = MenusHelper::Published($item);
     $lists->disabled = $item->type != 'url' ? 'readonly="true"' : '';
     $item->expansion = null;
     if ($item->type != 'url') {
         $lists->disabled = 'readonly="true"';
         $item->linkfield = '<input type="hidden" name="link" value="' . $item->link . '" />';
         if ($item->id && $item->type == 'component' && isset($item->linkparts['option'])) {
             $item->expansion = '&amp;expand=' . trim(str_replace('com_', '', $item->linkparts['option']));
         }
     } else {
         $lists->disabled = null;
         $item->linkfield = null;
     }
     $this->assignRef('lists', $lists);
     $this->assignRef('item', $item);
     $this->assignRef('urlparams', $urlparams);
     $this->assignRef('sysparams', $sysparams);
     $this->assignRef('params', $params);
     $this->assignRef('advanced', $advanced);
     $this->assignRef('comp', $component);
     $this->assignRef('menutypes', $menuTypes);
     $this->assignRef('name', $name);
     $this->assignRef('description', $description);
     // Add slider pane
     // TODO: allowAllClose should default true in J!1.6, so remove the array when it does.
     $pane =& JPane::getInstance('sliders', array('allowAllClose' => true));
     $this->assignRef('pane', $pane);
     // AGREGADO POR G2P
     $addTagsUrl = JRoute::_('index.php?option=com_customproperties&controller=hierarchictagging&view=hierarchictagging&ce_name=menu&id=' . $item->id);
     $selectTags = 'select v.name as value from #__custom_properties cp, #__custom_properties_values v, #__menu m where cp.value_id=v.id and cp.ref_table="menu" and cp.content_id=m.id and m.id=' . $item->id;
     $db = JFactory::getDBO();
     $db->setQuery($selectTags);
     $dbTags = $db->loadObjectList();
     $aux = array();
     foreach ($dbTags as $tag) {
         $aux[] = $tag->value;
     }
     $tags = implode(', ', $aux);
     $this->assign('addTagUrl', $addTagsUrl);
     $this->assign('tags', $tags);
     parent::display($tpl);
 }
開發者ID:BGCX261,項目名稱:zonales-svn-to-git,代碼行數:91,代碼來源:view.php


注:本文中的MenusHelper::Published方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。