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


PHP JFormFieldList::setup方法代码示例

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


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

示例1: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   object  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed   $value    The form field value to validate.
  * @param   string  $group    The field name group control value. This acts as as an array container for the field.
  *                            For example if the field has name="foo" and the group value is set to "bar" then the
  *                            full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @since   11.1
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     $defaultToTableValue = $this->element->attributes()->default_to_table;
     if ($defaultToTableValue) {
         $defaultToTableValue = (bool) $this->element->attributes()->{$defaultToTableValue}[0];
     } else {
         $defaultToTableValue = true;
     }
     if ($this->value == '' && $return && $defaultToTableValue) {
         $db = JFactory::getDbo();
         /*
          * Attempt to get the real Db collation (tmp fix before this makes it into J itself
          * see - https://github.com/joomla/joomla-cms/pull/2092
          */
         $db->setQuery('SHOW VARIABLES LIKE "collation_database"');
         try {
             $res = $db->loadObject();
             if (isset($res->Value)) {
                 $this->value = $res->Value;
             }
         } catch (RuntimeException $e) {
             $this->value = $db->getCollation();
         }
     }
     return $return;
 }
开发者ID:LGBGit,项目名称:tierno,代码行数:40,代码来源:collation.php

示例2: testGetInput

	/**
	 * Test the getInput method.
	 */
	public function testGetInput()
	{
		$form = new JFormInspector('form1');

		$this->assertThat(
			$form->load('<form><field name="list" type="list" /></form>'),
			$this->isTrue(),
			'Line:'.__LINE__.' XML string should load successfully.'
		);

		$field = new JFormFieldList($form);

		$this->assertThat(
			$field->setup($form->getXml()->field, 'value'),
			$this->isTrue(),
			'Line:'.__LINE__.' The setup method should return true.'
		);

		$this->assertThat(
			strlen($field->input),
			$this->greaterThan(0),
			'Line:'.__LINE__.' The getInput method should return something without error.'
		);

		// TODO: Should check all the attributes have come in properly.
	}
开发者ID:realityking,项目名称:JAJAX,代码行数:29,代码来源:JFormFieldListTest.php

示例3: setup

 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     // On change must always be the change context function
     $this->onchange = 'dpFieldsChangeContext(jQuery(this).val());';
     return $return;
 }
开发者ID:beingsane,项目名称:DPFields,代码行数:7,代码来源:section.php

示例4: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   3.2
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         $this->folder = (string) $this->element['folder'];
     }
     return $return;
 }
开发者ID:klas,项目名称:joomla-cms,代码行数:22,代码来源:plugins.php

示例5: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   3.2
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         $this->allowAdd = isset($this->element['allowAdd']) ? $this->element['allowAdd'] : '';
     }
     return $return;
 }
开发者ID:adjaika,项目名称:J3Base,代码行数:22,代码来源:categoryedit.php

示例6: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   3.2
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         $this->keyField = $this->element['key_field'] ? (string) $this->element['key_field'] : 'value';
         $this->valueField = $this->element['value_field'] ? (string) $this->element['value_field'] : (string) $this->element['name'];
         $this->translate = $this->element['translate'] ? (string) $this->element['translate'] : false;
         $this->query = (string) $this->element['query'];
     }
     return $return;
 }
开发者ID:grlf,项目名称:eyedock,代码行数:25,代码来源:sql.php

示例7: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   3.2
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         $this->filter = (string) $this->element['filter'];
         $this->exclude = (string) $this->element['exclude'];
         $this->stripPrefix = (string) $this->element['stripprefix'];
         $this->defaultLabel = (string) $this->element['defaultlabel'];
         $hideNone = (string) $this->element['hide_none'];
         $this->hideNone = $hideNone == 'true' || $hideNone == 'hideNone' || $hideNone == '1';
         $hideDefault = (string) $this->element['hide_default'];
         $this->hideDefault = $hideDefault == 'true' || $hideDefault == 'hideDefault' || $hideDefault == '1';
         $stripExt = (string) $this->element['stripext'];
         $this->stripExt = $stripExt == 'true' || $stripExt == 'stripExt' || $stripExt == '1';
         // Get the path in which to search for file options.
         $this->directory = (string) $this->element['directory'];
     }
     return $return;
 }
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:33,代码来源:fcfilelist.php

示例8: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the `<field>` tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   3.2
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         $this->checkedOptions = (string) $this->element['checked'];
     }
     return $return;
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:22,代码来源:checkboxes.php

示例9: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   3.2
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         // Check if its using the old way
         $this->query = (string) $this->element['query'];
         if (empty($this->query)) {
             // Get the query from the form
             $query = array();
             $defaults = array();
             $query['select'] = (string) $this->element['sql_select'];
             $query['from'] = (string) $this->element['sql_from'];
             $query['join'] = isset($this->element['sql_join']) ? (string) $this->element['sql_join'] : '';
             $query['where'] = isset($this->element['sql_where']) ? (string) $this->element['sql_where'] : '';
             $query['group'] = isset($this->element['sql_group']) ? (string) $this->element['sql_group'] : '';
             $query['order'] = (string) $this->element['sql_order'];
             // Get the filters
             $filters = isset($this->element['sql_filter']) ? explode(",", $this->element['sql_filter']) : '';
             // Get the default value for query if empty
             if (is_array($filters)) {
                 foreach ($filters as $key => $val) {
                     $name = "sql_default_{$val}";
                     $attrib = (string) $this->element[$name];
                     if (!empty($attrib)) {
                         $defaults[$val] = $attrib;
                     }
                 }
             }
             // Process the query
             $this->query = $this->processQuery($query, $filters, $defaults);
         }
         $this->keyField = isset($this->element['key_field']) ? (string) $this->element['key_field'] : 'value';
         $this->valueField = isset($this->element['value_field']) ? (string) $this->element['value_field'] : (string) $this->element['name'];
         $this->translate = isset($this->element['translate']) ? (string) $this->element['translate'] : false;
         $this->header = $this->element['header'] ? (string) $this->element['header'] : false;
     }
     return $return;
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:52,代码来源:sql.php

示例10: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement $element   The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed            $value     The form field value to validate.
  * @param   string           $group     The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  *
  * @see     JFormField::setup()
  * @since   1.2.0
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $return = parent::setup($element, $value, $group);
     if ($return) {
         $attributes = array('exclude', 'class');
         /* class is @deprecated >= J3.2 */
         foreach ($attributes as $attributeName) {
             if (isset($element[$attributeName])) {
                 $this->__set($attributeName, $element[$attributeName]);
             }
         }
     }
     return $return;
 }
开发者ID:fields-and-filters,项目名称:fields-and-filters,代码行数:28,代码来源:fieldsandfiltersstates.php

示例11: setup

 /**
  * Method to attach a JForm object to the field.
  *
  * @param   SimpleXMLElement  $element  The SimpleXMLElement object representing the <field /> tag for the form field object.
  * @param   mixed             $value    The form field value to validate.
  * @param   string            $group    The field name group control value. This acts as as an array container for the field.
  *                                      For example if the field has name="foo" and the group value is set to "bar" then the
  *                                      full field name would end up being "bar[foo]".
  *
  * @return  boolean  True on success.
  */
 public function setup(SimpleXMLElement $element, $value, $group = null)
 {
     $input = \Windwalker\DI\Container::getInstance()->get('input');
     $this->container = \Windwalker\DI\Container::getInstance($input->get('option'));
     return parent::setup($element, $value, $group);
 }
开发者ID:ForAEdesWeb,项目名称:AEW3,代码行数:17,代码来源:fieldtype.php


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