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


PHP JFormField::getLayoutData方法代码示例

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


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

示例1: getLayoutData

 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     $options = array();
     if ($this->value !== '') {
         $options = json_decode($this->value, true);
     }
     $data['customData'] = $options;
     return $data;
 }
开发者ID:ITPrism,项目名称:GamificationDistribution,代码行数:16,代码来源:gfycustomdata.php

示例2: getLayoutData

 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     $typeId = JTable::getInstance('Contenttype')->getTypeId($this->element['data-typeAlias']);
     $itemId = $this->form->getValue('id');
     $label = JText::_('JTOOLBAR_VERSIONS');
     $link = 'index.php?option=com_contenthistory&view=history&layout=modal&tmpl=component&field=' . $this->id . '&item_id=' . $itemId . '&type_id=' . $typeId . '&type_alias=' . $this->element['data-typeAlias'] . '&' . JSession::getFormToken() . '=1';
     $extraData = array('type' => $typeId, 'item' => $itemId, 'label' => $label, 'link' => $link);
     return array_merge($data, $extraData);
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:16,代码来源:contenthistory.php

示例3: getLayoutData

 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     // Load the current username if available.
     $project = new Crowdfunding\Project(JFactory::getDbo());
     $projectTitle = '';
     if (is_numeric($this->value)) {
         $project->load($this->value);
         $projectTitle = $project->get('title');
     }
     $extraData = array('projectTitle' => $projectTitle);
     return array_merge($data, $extraData);
 }
开发者ID:ITPrism,项目名称:CrowdfundingDistribution,代码行数:19,代码来源:cfproject.php

示例4: getLayoutData

 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     // Load the current username if available.
     $item = new Crowdfunding\Reward(JFactory::getDbo());
     $title = '';
     if (is_numeric($this->value)) {
         $options = array('fields' => array('a.id', 'a.title'));
         $item->load($this->value, $options);
         $title = $item->get('title');
     }
     $extraData = array('rewardTitle' => $title);
     return array_merge($data, $extraData);
 }
开发者ID:ITPrism,项目名称:CrowdfundingDistribution,代码行数:20,代码来源:cfreward.php

示例5: getLayoutData

 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     // Load the current username if available.
     $table = JTable::getInstance('user');
     if (is_numeric($this->value)) {
         $table->load($this->value);
     } elseif (strtoupper($this->value) == 'CURRENT') {
         // 'CURRENT' is not a reasonable value to be placed in the html
         $this->value = JFactory::getUser()->id;
         $table->load($this->value);
     } else {
         $table->name = JText::_('JLIB_FORM_SELECT_USER');
     }
     $extraData = array('userName' => $table->name, 'groups' => $this->getGroups(), 'excluded' => $this->getExcluded());
     return array_merge($data, $extraData);
 }
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:23,代码来源:user.php

示例6: getLayoutData

 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     // Load the current username if available.
     $table = JTable::getInstance('user');
     if (is_numeric($this->value)) {
         $table->load($this->value);
     } elseif (strtoupper($this->value) == 'CURRENT') {
         // 'CURRENT' is not a reasonable value to be placed in the html
         $this->value = JFactory::getUser()->id;
         $table->load($this->value);
     } else {
         $table->name = JText::_('JLIB_FORM_SELECT_USER');
     }
     // Initialize JavaScript field attributes.
     $onchange = (string) $this->element['onchange'];
     $extraData = array('onchange' => $onchange, 'userName' => $table->name, 'groups' => $this->getGroups(), 'excluded' => $this->getExcluded(), 'readOnly' => $this->readonly, 'class' => $this->class);
     return array_merge($data, $extraData);
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:25,代码来源:user.php

示例7: getLayoutData

 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     // Initialize value
     $name = '';
     if (is_numeric($this->value)) {
         $name = JUser::getInstance($this->value)->name;
     } elseif (strtoupper($this->value) == 'CURRENT') {
         // 'CURRENT' is not a reasonable value to be placed in the html
         $current = JFactory::getUser();
         $this->value = $current->id;
         $data['value'] = $this->value;
         $name = $current->name;
     } else {
         $name = JText::_('JLIB_FORM_SELECT_USER');
     }
     $extraData = array('userName' => $name, 'groups' => $this->getGroups(), 'excluded' => $this->getExcluded());
     return array_merge($data, $extraData);
 }
开发者ID:adjaika,项目名称:J3Base,代码行数:25,代码来源:user.php

示例8: getLayoutData

 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since 3.7
  */
 protected function getLayoutData()
 {
     $data = parent::getLayoutData();
     // Initialize some field attributes.
     $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : '';
     $inputmode = !empty($this->inputmode) ? ' inputmode="' . $this->inputmode . '"' : '';
     $dirname = !empty($this->dirname) ? ' dirname="' . $this->dirname . '"' : '';
     /* Get the field options for the datalist.
     			Note: getSuggestions() is deprecated and will be changed to getOptions() with 4.0. */
     $options = (array) $this->getSuggestions();
     $extraData = array('maxLength' => $maxLength, 'pattern' => $this->pattern, 'inputmode' => $inputmode, 'dirname' => $dirname, 'options' => $options);
     return array_merge($data, $extraData);
 }
开发者ID:eshiol,项目名称:joomla-cms,代码行数:20,代码来源:text.php

示例9: getLayoutData

 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since  3.6.3
  */
 protected function getLayoutData()
 {
     $data = parent::getLayoutData();
     $extraData = array('ordering' => $this->form->getValue('ordering'), 'clientId' => $this->form->getValue('client_id'), 'name' => $this->name, 'token' => JSession::getFormToken() . '=1', 'element' => $this->form->getName() . '_' . $this->linked);
     return array_merge($data, $extraData);
 }
开发者ID:iFactoryDigital,项目名称:gympieradiology,代码行数:13,代码来源:moduleorder.php

示例10: getLayoutData

 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since 3.7
  */
 protected function getLayoutData()
 {
     $data = parent::getLayoutData();
     // Initialize some field attributes.
     $columns = $this->columns ? ' cols="' . $this->columns . '"' : '';
     $rows = $this->rows ? ' rows="' . $this->rows . '"' : '';
     $maxlength = $this->maxlength ? ' maxlength="' . $this->maxlength . '"' : '';
     $extraData = array('maxlength' => $maxlength, 'rows' => $rows, 'columns' => $columns);
     return array_merge($data, $extraData);
 }
开发者ID:eshiol,项目名称:joomla-cms,代码行数:17,代码来源:textarea.php

示例11: getLayoutData

 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since 3.7
  */
 protected function getLayoutData()
 {
     return parent::getLayoutData();
 }
开发者ID:eshiol,项目名称:joomla-cms,代码行数:11,代码来源:hidden.php

示例12: getInput

 /**
  * Method to get the field input markup.
  *
  * @return  string  The field input markup.
  *
  * @since   3.6
  */
 protected function getInput()
 {
     $value = $this->value ? $this->value : array();
     // Prepare data for renderer
     $data = parent::getLayoutData();
     $tmpl = null;
     $forms = array();
     $control = $this->name;
     try {
         // Prepare the form template
         $formname = 'subform' . ($this->group ? $this->group . '.' : '.') . $this->fieldname;
         $tmplcontrol = !$this->multiple ? $control : $control . '[' . $this->fieldname . 'X]';
         $tmpl = JForm::getInstance($formname, $this->formsource, array('control' => $tmplcontrol));
         // Prepare the forms for exiting values
         if ($this->multiple) {
             $value = array_values($value);
             $c = max($this->min, min(count($value), $this->max));
             for ($i = 0; $i < $c; $i++) {
                 $itemcontrol = $control . '[' . $this->fieldname . $i . ']';
                 $itemform = JForm::getInstance($formname . $i, $this->formsource, array('control' => $itemcontrol));
                 if (!empty($value[$i])) {
                     $itemform->bind($value[$i]);
                 }
                 $forms[] = $itemform;
             }
         } else {
             $tmpl->bind($value);
             $forms[] = $tmpl;
         }
     } catch (Exception $e) {
         return $e->getMessage();
     }
     $data['tmpl'] = $tmpl;
     $data['forms'] = $forms;
     $data['min'] = $this->min;
     $data['max'] = $this->max;
     $data['control'] = $control;
     $data['buttons'] = $this->buttons;
     $data['fieldname'] = $this->fieldname;
     $data['groupByFieldset'] = $this->groupByFieldset;
     // Prepare renderer
     $renderer = $this->getRenderer($this->layout);
     // Allow to define some JLayout options as attribute of the element
     if ($this->element['component']) {
         $renderer->setComponent((string) $this->element['component']);
     }
     if ($this->element['client']) {
         $renderer->setClient((string) $this->element['client']);
     }
     // Render
     $html = $renderer->render($data);
     // Add hidden input on front of the subform inputs, in multiple mode
     // for allow to submit an empty value
     if ($this->multiple) {
         $html = '<input name="' . $this->name . '" type="hidden" value="" />' . $html;
     }
     return $html;
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:65,代码来源:subform.php

示例13: getLayoutData

 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since 3.5
  */
 protected function getLayoutData()
 {
     $lang = JFactory::getLanguage();
     $data = parent::getLayoutData();
     $color = strtolower($this->value);
     $color = !$color ? '' : $color;
     // Position of the panel can be: right (default), left, top or bottom (default RTL is left)
     $position = ' data-position="' . ($lang->isRTL() && $this->position == 'default' ? 'left' : $this->position) . '"';
     if (!$color || in_array($color, array('none', 'transparent'))) {
         $color = 'none';
     } elseif ($color['0'] != '#') {
         $color = '#' . $color;
     }
     // Assign data for simple/advanced mode
     $controlModeData = $this->control === 'simple' ? $this->getSimpleModeLayoutData() : $this->getAdvancedModeLayoutData($lang);
     $extraData = array('color' => $color, 'format' => $this->format, 'keywords' => $this->keywords, 'position' => $position, 'validate' => $this->validate);
     return array_merge($data, $extraData, $controlModeData);
 }
开发者ID:eshiol,项目名称:joomla-cms,代码行数:25,代码来源:color.php

示例14: getLayoutData

 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since 3.7
  */
 protected function getLayoutData()
 {
     $data = parent::getLayoutData();
     // Initialize some field attributes.
     $extraData = array('maxLength' => $this->maxLength, 'meter' => $this->meter, 'threshold' => $this->threshold, 'meter' => $this->meter);
     return array_merge($data, $extraData);
 }
开发者ID:eshiol,项目名称:joomla-cms,代码行数:14,代码来源:password.php

示例15: getLayoutData

 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since 3.7
  */
 protected function getLayoutData()
 {
     $data = parent::getLayoutData();
     // Initialize some field attributes.
     $extraData = array('max' => $this->max, 'min' => $this->min, 'step' => $this->step, 'value' => $this->value);
     return array_merge($data, $extraData);
 }
开发者ID:eshiol,项目名称:joomla-cms,代码行数:14,代码来源:number.php


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