当前位置: 首页>>代码示例>>PHP>>正文


PHP T3::getDefaultTemplate方法代码示例

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


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

示例1: onContentPrepareForm

 /**
  * Add JA Extended menu parameter in administrator
  *
  * @param   JForm $form   The form to be altered.
  * @param   array $data   The associated data for the form
  *
  * @return  null
  */
 function onContentPrepareForm($form, $data)
 {
     if (defined('T3_PLUGIN')) {
         if (T3::detect() && ($form->getName() == 'com_templates.style' || $form->getName() == 'com_config.templates')) {
             JForm::addFormPath(T3_PATH . '/params');
             $form->loadFile('template', false);
             // extend parameters
             T3Bot::prepareForm($form);
             //search for global parameters and store in user state
             if (is_object($data)) {
                 $app = JFactory::getApplication();
                 $fdata = $data->getProperties();
                 $pglobals = array();
                 foreach ($form->getGroup('params') as $param) {
                     if ($form->getFieldAttribute($param->fieldname, 'global', 0, 'params')) {
                         $pglobals[] = array('name' => $param->fieldname, 'value' => isset($fdata['params'][$param->fieldname]) ? $fdata['params'][$param->fieldname] : '');
                     }
                 }
                 $app->setUserState('oparams', $pglobals);
             }
         }
         $tmpl = T3::detect() ? T3::detect() : (T3::getDefaultTemplate(true) ? T3::getDefaultTemplate(true) : false);
         if ($tmpl) {
             $tplpath = JPATH_ROOT . '/templates/' . (is_object($tmpl) && !empty($tmpl->tplname) ? $tmpl->tplname : $tmpl);
             $formpath = $tplpath . '/etc/form/';
             JForm::addFormPath($formpath);
             $extended = $formpath . $form->getName() . '.xml';
             if (is_file($extended)) {
                 JFactory::getLanguage()->load('tpl_' . $tmpl, JPATH_SITE);
                 $form->loadFile($form->getName(), false);
             }
             // load extra fields for specified module in format com_modules.module.module_name.xml
             if ($form->getName() == 'com_modules.module') {
                 $module = isset($data->module) ? $data->module : '';
                 if (!$module) {
                     $jform = JFactory::getApplication()->input->get("jform", null, 'array');
                     $module = $jform['module'];
                 }
                 $extended = $formpath . $module . '.xml';
                 if (is_file($extended)) {
                     JFactory::getLanguage()->load('tpl_' . $tmpl, JPATH_SITE);
                     $form->loadFile($module, false);
                 }
             }
             //extend extra fields
             T3Bot::extraFields($form, $data, $tplpath);
         }
     }
 }
开发者ID:Tommar,项目名称:vino2,代码行数:57,代码来源:t3.php

示例2: onContentPrepareForm

 /**
  * Add JA Extended menu parameter in administrator
  *
  * @param   JForm $form   The form to be altered.
  * @param   array $data   The associated data for the form
  *
  * @return  null
  */
 function onContentPrepareForm($form, $data)
 {
     if (defined('T3_PLUGIN')) {
         $form_name = $form->getName();
         // make it compatible with AMM
         if ($form_name == 'com_advancedmodules.module') {
             $form_name = 'com_modules.module';
         }
         if (T3::detect() && ($form_name == 'com_templates.style' || $form_name == 'com_config.templates')) {
             $_form = clone $form;
             $_form->loadFile(T3_PATH . '/params/template.xml', false);
             //custom config in custom/etc/assets.xml
             $cusXml = T3Path::getPath('etc/assets.xml');
             if ($cusXml && file_exists($cusXml)) {
                 $_form->loadFile($cusXml, true, '//config');
             }
             // extend parameters
             T3Bot::prepareForm($form);
             //search for global parameters and store in user state
             $app = JFactory::getApplication();
             $gparams = array();
             foreach ($_form->getGroup('params') as $param) {
                 if ($_form->getFieldAttribute($param->fieldname, 'global', 0, 'params')) {
                     $gparams[] = $param->fieldname;
                 }
             }
             $this->gparams = $gparams;
         }
         $tmpl = T3::detect() ? T3::detect() : (T3::getDefaultTemplate(true) ? T3::getDefaultTemplate(true) : false);
         if ($tmpl) {
             $tplpath = JPATH_ROOT . '/templates/' . (is_object($tmpl) && !empty($tmpl->tplname) ? $tmpl->tplname : $tmpl);
             $formpath = $tplpath . '/etc/form/';
             JForm::addFormPath($formpath);
             $extended = $formpath . $form_name . '.xml';
             if (is_file($extended)) {
                 JFactory::getLanguage()->load('tpl_' . $tmpl, JPATH_SITE);
                 $form->loadFile($form_name, false);
             }
             // load extra fields for specified module in format com_modules.module.module_name.xml
             if ($form_name == 'com_modules.module') {
                 $module = isset($data->module) ? $data->module : '';
                 if (!$module) {
                     $jform = JFactory::getApplication()->input->get("jform", null, 'array');
                     $module = $jform['module'];
                 }
                 $extended = $formpath . $module . '.xml';
                 if (is_file($extended)) {
                     JFactory::getLanguage()->load('tpl_' . $tmpl, JPATH_SITE);
                     $form->loadFile($module, false);
                 }
             }
             //extend extra fields
             T3Bot::extraFields($form, $data, $tplpath);
         }
         // Extended by T3
         $extended = T3_ADMIN_PATH . '/admin/form/' . $form_name . '.xml';
         if (is_file($extended)) {
             $form->loadFile($extended, false);
         }
     }
 }
开发者ID:lazarch,项目名称:t3,代码行数:69,代码来源:t3.php

示例3: onContentPrepareForm

 /**
  * Add JA Extended menu parameter in administrator
  *
  * @param   JForm   $form   The form to be altered.
  * @param   array   $data   The associated data for the form
  *
  * @return  null
  */
 function onContentPrepareForm($form, $data)
 {
     if (T3::detect() && $form->getName() == 'com_templates.style') {
         $this->loadLanguage();
         JForm::addFormPath(T3_PATH . DIRECTORY_SEPARATOR . 'params');
         $form->loadFile('template', false);
     }
     $tmpl = T3::detect() ? T3::detect() : (T3::getDefaultTemplate() ? T3::getDefaultTemplate() : false);
     if ($tmpl) {
         $extended = JPATH_ROOT . '/templates/' . $tmpl . '/etc/form/' . $form->getName() . '.xml';
         if (is_file($extended)) {
             JFactory::getLanguage()->load('tpl_' . $tmpl, JPATH_SITE);
             JForm::addFormPath(dirname($extended));
             $form->loadFile($form->getName(), false);
         }
     }
 }
开发者ID:GitIPFire,项目名称:Homeworks,代码行数:25,代码来源:t3.php


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