• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP TemplatesHelper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中TemplatesHelper的典型用法代码示例。如果您正苦于以下问题:PHP TemplatesHelper类的具体用法?PHP TemplatesHelper怎么用?PHP TemplatesHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TemplatesHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _setToolbar

 /**
  * Setup the Toolbar.
  */
 protected function _setToolbar()
 {
     $state = $this->get('State');
     $canDo = TemplatesHelper::getActions();
     $isSite = $state->get('filter.client_id') == 0;
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('style.edit');
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::custom('styles.sethome', 'default.png', 'default_f2.png', 'Templates_Toolbar_Set_Home', true);
     }
     JToolBarHelper::title(JText::_('Templates_Manager_Styles'), 'thememanager');
     if ($canDo->get('core.create') && $isSite) {
         JToolBarHelper::addNew('styles.duplicate', 'Templates_Toolbar_Save_Copy');
     }
     if ($canDo->get('core.delete') && $isSite) {
         JToolBarHelper::deleteList('', 'styles.delete');
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_templates');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.templates');
 }
开发者ID:joebushi,项目名称:joomla,代码行数:28,代码来源:view.html.php


示例2: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     $size = $node->attributes('size');
     $multiple = $node->attributes('multiple');
     $subtemplates = $this->def($node->attributes('subtemplates'), 1);
     $control = $control_name . '[' . $name . ']';
     $attribs = 'class="inputbox"';
     if ($multiple) {
         if (!is_array($value)) {
             $value = explode(',', $value);
         }
         $attribs .= ' multiple="multiple"';
         $control .= '[]';
     }
     require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_templates' . DS . 'helpers' . DS . 'template.php';
     $rows = TemplatesHelper::parseXMLTemplateFiles(JPATH_ROOT . DS . 'templates');
     $options = $this->createList($rows, JPATH_ROOT . DS . 'templates', $subtemplates);
     if ($size) {
         $attribs .= ' size="' . $size . '"';
     } else {
         $attribs .= ' size="' . (count($options) > 10 ? 10 : count($options)) . '"';
     }
     $list = JHTML::_('select.genericlist', $options, $control, $attribs, 'value', 'text', $value, $control_name . $name);
     return $list;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:25,代码来源:templates.php


示例3: addToolbar

 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     $state = $this->get('State');
     $canDo = TemplatesHelper::getActions();
     $isSite = $state->get('filter.client_id') == 0;
     JToolBarHelper::title(JText::_('COM_TEMPLATES_MANAGER_STYLES'), 'thememanager');
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::makeDefault('styles.setDefault', 'COM_TEMPLATES_TOOLBAR_SET_HOME');
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('style.edit');
     }
     if ($canDo->get('core.create')) {
         JToolBarHelper::custom('styles.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'styles.delete');
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_templates');
         JToolBarHelper::divider();
     }
     JToolBarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_STYLES');
 }
开发者ID:exntu,项目名称:joomla-cms,代码行数:32,代码来源:view.html.php


示例4: display

 public function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('Template Manager'), 'thememanager');
     JToolBarHelper::custom('edit', 'back.png', 'back_f2.png', 'Back', false, false);
     require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'templates.php';
     // Initialise some variables
     $option = JRequest::getCmd('option');
     $id = JRequest::getVar('id', '', 'method', 'int');
     $template = TemplatesHelper::getTemplateName($id);
     $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int'));
     $tp = true;
     $url = $client->id ? JURI::base() : JURI::root();
     if (!$template) {
         return JError::raiseWarning(500, JText::_('Template not specified'));
     }
     // Set FTP credentials, if given
     jimport('joomla.client.helper');
     JClientHelper::setCredentialsFromRequest('ftp');
     $this->assignRef('option', $option);
     $this->assignRef('client', $client);
     $this->assignRef('id', $id);
     $this->assignRef('template', $template);
     $this->assignRef('tp', $tp);
     $this->assignRef('url', $url);
     parent::display($tpl);
 }
开发者ID:joebushi,项目名称:joomla,代码行数:26,代码来源:view.html.php


示例5: addToolbar

 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $canDo = TemplatesHelper::getActions();
     JToolBarHelper::title($isNew ? JText::_('COM_TEMPLATES_MANAGER_ADD_STYLE') : JText::_('COM_TEMPLATES_MANAGER_EDIT_STYLE'), 'thememanager');
     // If not checked out, can save the item.
     if ($canDo->get('core.edit')) {
         JToolBarHelper::apply('style.apply', 'JTOOLBAR_APPLY');
         JToolBarHelper::save('style.save', 'JTOOLBAR_SAVE');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::custom('style.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('style.cancel', 'JTOOLBAR_CANCEL');
     } else {
         JToolBarHelper::cancel('style.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     // Get the help information for the template item.
     $lang = JFactory::getLanguage();
     $help = $this->get('Help');
     if ($lang->hasKey($help->url)) {
         $debug = $lang->setDebug(false);
         $url = JText::_($help->url);
         $lang->setDebug($debug);
     } else {
         $url = null;
     }
     JToolBarHelper::help($help->key, false, $url);
 }
开发者ID:akksi,项目名称:jcg,代码行数:39,代码来源:view.html.php


示例6: addToolbar

 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     Request::setVar('hidemainmenu', true);
     $isNew = $this->item->id == 0;
     $canDo = TemplatesHelper::getActions();
     Toolbar::title($isNew ? Lang::txt('COM_TEMPLATES_MANAGER_ADD_STYLE') : Lang::txt('COM_TEMPLATES_MANAGER_EDIT_STYLE'), 'thememanager');
     // If not checked out, can save the item.
     if ($canDo->get('core.edit')) {
         Toolbar::apply('style.apply');
         Toolbar::save('style.save');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         Toolbar::save2copy('style.save2copy');
     }
     if (empty($this->item->id)) {
         Toolbar::cancel('style.cancel');
     } else {
         Toolbar::cancel('style.cancel', 'JTOOLBAR_CLOSE');
     }
     Toolbar::divider();
     // Get the help information for the template item.
     $lang = Lang::getRoot();
     $help = $this->get('Help');
     if ($lang->hasKey($help->url)) {
         $debug = $lang->setDebug(false);
         $url = Lang::txt($help->url);
         $lang->setDebug($debug);
     } else {
         $url = null;
     }
     Toolbar::help('style');
     //$help->key, false, $url);
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:39,代码来源:view.html.php


示例7: getOptions

 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  *
  * @since   1.6
  */
 public function getOptions()
 {
     $app = JFactory::getApplication();
     $clientId = $app->getUserStateFromRequest('com_templates.styles.filter.client_id', 'filter_client_id', null);
     $options = TemplatesHelper::getTemplateOptions($clientId);
     return array_merge(parent::getOptions(), $options);
 }
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:14,代码来源:templatename.php


示例8: getItem

 function getItem()
 {
     global $mainframe;
     jimport('joomla.filesystem.path');
     if (!$this->template) {
         return JError::raiseWarning(500, 'Template not specified');
     }
     $tBaseDir = JPath::clean(JPATH_RSGALLERY2_SITE . '/templates');
     if (!is_dir($tBaseDir . '/' . $this->template)) {
         return JError::raiseWarning(500, 'Template not found');
     }
     $lang =& JFactory::getLanguage();
     $lang->load('tpl_' . $this->template, JPATH_RSGALLERY2_SITE);
     $ini = JPATH_RSGALLERY2_SITE . '/templates/' . $this->template . '/params.ini';
     $xml = JPATH_RSGALLERY2_SITE . '/templates/' . $this->template . '/templateDetails.xml';
     $row = TemplatesHelper::parseXMLTemplateFile($tBaseDir, $this->template);
     jimport('joomla.filesystem.file');
     // Read the ini file
     if (JFile::exists($ini)) {
         $content = JFile::read($ini);
     } else {
         $content = null;
     }
     $params = new JParameter($content, $xml, 'template');
     // Set FTP credentials, if given
     jimport('joomla.client.helper');
     $ftp =& JClientHelper::setCredentialsFromRequest('ftp');
     $item = new stdClass();
     $item->params = $params;
     $item->row = $row;
     $item->type = $this->_type;
     $item->template = $this->template;
     return $item;
 }
开发者ID:realityking,项目名称:rsgallery2,代码行数:34,代码来源:template.php


示例9: getOptions

 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  *
  * @since   1.6
  */
 public function getOptions()
 {
     // Get the client_id filter from the user state.
     $clientId = JFactory::getApplication()->getUserStateFromRequest('com_templates.styles.client_id', 'client_id', '0', 'string');
     // Get the templates for the selected client_id.
     $options = TemplatesHelper::getTemplateOptions($clientId);
     // Merge into the parent options.
     return array_merge(parent::getOptions(), $options);
 }
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:16,代码来源:templatename.php


示例10: getItems

 /**
  * Override parent getItems to add extra XML metadata.
  *
  * @return  array
  *
  * @since   1.6
  */
 public function getItems()
 {
     $items = parent::getItems();
     foreach ($items as &$item) {
         $client = JApplicationHelper::getClientInfo($item->client_id);
         $item->xmldata = TemplatesHelper::parseXMLTemplateFile($client->path, $item->element);
     }
     return $items;
 }
开发者ID:JonatanLiecheski,项目名称:MeditecJoomla,代码行数:16,代码来源:templates.php


示例11: addToolbar

 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $canDo = TemplatesHelper::getActions();
     JToolBarHelper::title(JText::_('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE'), 'thememanager');
     JToolBarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE');
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT');
 }
开发者ID:Joomla-on-NoSQL,项目名称:LaMojo,代码行数:15,代码来源:view.html.php


示例12: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     include_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/template.php';
     $template_path = JPATH_ADMINISTRATOR . '/templates';
     $templates = TemplatesHelper::parseXMLTemplateFiles($template_path);
     $options = array();
     $options[] = JHTML::_('select.option', '', JText::_('DEFAULT'));
     foreach ($templates as $t) {
         $options[] = JHTML::_('select.option', $t->directory, $t->name);
     }
     return JHTML::_('select.genericlist', $options, '' . $control_name . '[' . $name . '][]', 'class="inputbox"', 'value', 'text', $value);
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:12,代码来源:admintemplate.php


示例13: getInput

 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $size = (int) $this->def('size');
     $multiple = $this->def('multiple');
     $subtemplates = $this->def('subtemplates', 1);
     $show_system = $this->def('show_system', 1);
     require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php';
     $rows = TemplatesHelper::getTemplateOptions('0');
     $options = $this->createList($rows, JPATH_ROOT . '/templates', $subtemplates, $show_system);
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
开发者ID:brojask,项目名称:colegio-abogados-joomla,代码行数:13,代码来源:templates.php


示例14: getInput

 /**
  * Method to get the output of this element
  *
  * @param null
  * @return string
  */
 protected function getInput()
 {
     $name = $this->name;
     $fieldName = $this->fieldname;
     $value = $this->value;
     require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php';
     $options = TemplatesHelper::getTemplateOptions(0);
     if (!empty($options) && is_array($options)) {
         array_unshift($options, array('value' => '', 'text' => ''));
         return JHTML::_('select.genericlist', $options, $fieldName, null, 'value', 'text', MagebridgeModelConfig::load($fieldName));
     }
     return '<input type="text" name="' . $name . '" value="' . $value . '" />';
 }
开发者ID:apiceweb,项目名称:MageBridgeCore,代码行数:19,代码来源:template.php


示例15: addToolbar

 /**
  * Add the page title and toolbar.
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $canDo = JHelperContent::getActions('com_templates');
     JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_TEMPLATES'), 'eye thememanager');
     if ($canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_templates');
         JToolbarHelper::divider();
     }
     JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES');
     JHtmlSidebar::setAction('index.php?option=com_templates&view=templates');
     JHtmlSidebar::addFilter(JText::_('JGLOBAL_FILTER_CLIENT'), 'filter_client_id', JHtml::_('select.options', TemplatesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')));
     $this->sidebar = JHtmlSidebar::render();
 }
开发者ID:WineWorld,项目名称:joomlatrialcmbg,代码行数:20,代码来源:view.html.php


示例16: getInput

 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $subtemplates = $this->def('subtemplates', 1);
     $show_system = $this->def('show_system', 1);
     require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php';
     $rows = TemplatesHelper::getTemplateOptions('0');
     $options = $this->createList($rows, JPATH_ROOT . '/templates', $subtemplates, $show_system);
     $attr = '';
     $attr .= $this->def('size') ? ' size="' . (int) $this->def('size') . '"' : '';
     $attr .= $this->def('multiple') ? ' multiple="multiple"' : '';
     return JHtml::_('select.genericlist', $options, $this->name . '[]', trim($attr), 'value', 'text', $this->value, $this->id);
 }
开发者ID:greyhat777,项目名称:vuslinterliga,代码行数:13,代码来源:templates.php


示例17: addToolbar

 /**
  * Add the page title and toolbar.
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     $canDo = TemplatesHelper::getActions();
     JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_EDIT_FILE'), 'thememanager');
     // Can save the item.
     if ($canDo->get('core.edit')) {
         JToolbarHelper::apply('source.apply');
         JToolbarHelper::save('source.save');
     }
     JToolbarHelper::cancel('source.cancel');
     JToolbarHelper::divider();
     JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT_SOURCE');
 }
开发者ID:TFToto,项目名称:playjoom-builds,代码行数:19,代码来源:view.html.php


示例18: parseXMLTemplateFiles

 function parseXMLTemplateFiles($templateBaseDir)
 {
     // Read the template folder to find templates
     jimport('joomla.filesystem.folder');
     $templateDirs = JFolder::folders($templateBaseDir);
     $rows = array();
     // Check that the directory contains an xml file
     foreach ($templateDirs as $templateDir) {
         if (!($data = TemplatesHelper::parseXMLTemplateFile($templateBaseDir, $templateDir))) {
             continue;
         } else {
             $rows[] = $data;
         }
     }
     return $rows;
 }
开发者ID:jicheng17,项目名称:comanova,代码行数:16,代码来源:template.php


示例19: display

 /**
  * Method to display a view.
  *
  * @param	boolean			If true, the view output will be cached
  * @param	array			An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return	JController		This object to support chaining.
  * @since	1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     // Load the submenu.
     TemplatesHelper::addSubmenu(JRequest::getCmd('view', 'styles'));
     $view = JRequest::getCmd('view', 'styles');
     $layout = JRequest::getCmd('layout', 'default');
     $id = JRequest::getInt('id');
     // Check for edit form.
     if ($view == 'style' && $layout == 'edit' && !$this->checkEditId('com_templates.edit.style', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_templates&view=styles', false));
         return false;
     }
     parent::display();
 }
开发者ID:Nechoj23,项目名称:SVI-Homepage,代码行数:26,代码来源:controller.php


示例20: display

 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a Error object.
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     $this->preview = JComponentHelper::getParams('com_templates')->get('template_positions_display');
     TemplatesHelper::addSubmenu('styles');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     return parent::display($tpl);
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:25,代码来源:view.html.php



注:本文中的TemplatesHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP TemporaryFileManager类代码示例发布时间:2022-05-23
下一篇:
PHP Templates类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap