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

PHP JFormFieldList类代码示例

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

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



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

示例1: 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


示例2: getOptions

 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  *
  * @since   11.1
  */
 public function getOptions()
 {
     $options = array();
     $db = JFactory::getDbo();
     $query = $db->getQuery(true)->select('code As value, title As `text`, print_title')->from('#__sibdiet_countries')->order('title')->where('published = 1');
     $db->setQuery($query);
     try {
         $options = $db->loadObjectList();
     } catch (RuntimeException $e) {
         JError::raiseWarning(500, $e->getMessage());
     }
     $lang_tag = JFactory::getLanguage()->get('tag');
     foreach ($options as $option) {
         // Convert the print_title field to an array.
         $registry = new JRegistry();
         $registry->loadString($option->print_title);
         $print_title = $registry->toArray();
         if (array_key_exists($lang_tag, $print_title)) {
             $option->text = $print_title[$lang_tag];
         }
     }
     // Sort Options
     usort($options, function ($a, $b) {
         return strcmp($a->text, $b->text);
     });
     return array_merge(parent::getOptions(), $options);
 }
开发者ID:smhnaji,项目名称:sdnet,代码行数:34,代码来源:countries.php


示例3: getOptions

 protected function getOptions()
 {
     $options = array();
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query = '
     SELECT
         ct.id AS id,
         c.locale_key AS container_name,
         ct.liters AS liters
     FROM #__reomi_container_types AS ct
     INNER JOIN #__reomi_containers AS c ON ct.container_id = c.id
     ORDER BY
         c.name ASC,
         ct.liters ASC
     ';
     $db->setQuery($query);
     $containers = $db->loadObjectList();
     $options = array();
     if ($containers) {
         foreach ($containers as $item) {
             $options[] = JHtml::_('select.option', $item->id, JText::_($item->container_name) . " " . $item->liters . "L");
         }
     }
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
开发者ID:croissanceimage,项目名称:com_reomi,代码行数:27,代码来源:containertypes.php


示例4: getOptions

 /**
  * Method to get a list of options for a list input.
  *
  * @return	array		An array of JHtml options.
  *
  * @since   11.4
  */
 protected function getOptions()
 {
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     // Select the required fields from the table.
     $query->select('c.id, c.country, c.country_jtext');
     $query->from('`#__tj_country` AS c');
     $query->where('c.com_quick2cart = 1');
     $query->order($db->escape('c.ordering ASC'));
     $db->setQuery($query);
     // Get all countries.
     $countries = $db->loadObjectList();
     $options = array();
     // Load lang file for countries
     $lang = JFactory::getLanguage();
     $lang->load('tjgeo.countries', JPATH_SITE, null, false, true);
     foreach ($countries as $c) {
         if ($lang->hasKey(strtoupper($c->country_jtext))) {
             $c->country = JText::_($c->country_jtext);
         }
         $options[] = JHtml::_('select.option', $c->id, $c->country);
     }
     if (!$this->loadExternally) {
         // Merge any additional options in the XML definition.
         $options = array_merge(parent::getOptions(), $options);
     }
     return $options;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:35,代码来源:countries.php


示例5: getOptions

 /**
  * Method to get the custom field options.
  * Use the query attribute to supply a query to generate the list.
  *
  * @return  array  The field option objects.
  *
  * @since   11.1
  */
 protected function getOptions()
 {
     // Initialize variables.
     $options = array();
     // Initialize some field attributes.
     $key = $this->element['key_field'] ? (string) $this->element['key_field'] : 'value';
     $value = $this->element['value_field'] ? (string) $this->element['value_field'] : (string) $this->element['name'];
     $translate = $this->element['translate'] ? (string) $this->element['translate'] : false;
     $query = (string) $this->element['query'];
     // Get the database object.
     $db = JFactory::getDBO();
     // Set the query and get the result list.
     $db->setQuery($query);
     $items = $db->loadObjectlist();
     // Check for an error.
     if ($db->getErrorNum()) {
         JError::raiseWarning(500, $db->getErrorMsg());
         return $options;
     }
     // Build the field options.
     if (!empty($items)) {
         foreach ($items as $item) {
             if ($translate == true) {
                 $options[] = JHtml::_('select.option', $item->{$key}, JText::_($item->{$value}));
             } else {
                 $options[] = JHtml::_('select.option', $item->{$key}, $item->{$value});
             }
         }
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
开发者ID:jimyb3,项目名称:mathematicalteachingsite,代码行数:41,代码来源:sql.php


示例6: getOptions

 /**
  * Method to get the field options.
  *
  * @since 2.0
  *
  * @return  array  The field option objects.
  */
 protected function getOptions()
 {
     $options = parent::getOptions();
     if (!empty($options)) {
         return $options;
     }
     // If no custom options were defined let's figure out which ones of the
     // defaults we shall use...
     $config = array('published' => 1, 'unpublished' => 1, 'archived' => 0, 'trash' => 0, 'all' => 0);
     $stack = array();
     // We are no longer using jgrid.publishedOptions as it's returning
     // untranslated strings, unsuitable for our purposes.
     if ($this->element['show_published'] == 'false') {
         $stack[] = JHtml::_('select.option', '1', JText::_('JPUBLISHED'));
     }
     if ($this->element['show_unpublished'] == 'false') {
         $stack[] = JHtml::_('select.option', '0', JText::_('JUNPUBLISHED'));
     }
     if ($this->element['show_archived'] == 'true') {
         $stack[] = JHtml::_('select.option', '2', JText::_('JARCHIVED'));
     }
     if ($this->element['show_trash'] == 'true') {
         $stack[] = JHtml::_('select.option', '-2', JText::_('JTRASHED'));
     }
     if ($this->element['show_all'] == 'true') {
         $stack[] = JHtml::_('select.option', '*', JText::_('JALL'));
     }
     return $stack;
 }
开发者ID:alxstuart,项目名称:ajfs.me,代码行数:36,代码来源:published.php


示例7: getOptions

	/**
	 * Method to get the field options for the list of installed editors.
	 *
	 * @return  array  The field option objects.
	 * @since   11.1
	 */
	protected function getOptions()
	{
		// Get the database object and a new query object.
		$db		= JFactory::getDBO();
		$query	= $db->getQuery(true);

		// Build the query.
		$query->select('element AS value, name AS text');
		$query->from('#__extensions');
		$query->where('folder = '.$db->quote('editors'));
		$query->where('enabled = 1');
		$query->order('ordering, name');

		// Set the query and load the options.
		$db->setQuery($query);
		$options = $db->loadObjectList();
		$lang = JFactory::getLanguage();
		foreach ($options as $i=>$option) {
				$lang->load('plg_editors_'.$option->value, JPATH_ADMINISTRATOR, null, false, false)
			||	$lang->load('plg_editors_'.$option->value, JPATH_PLUGINS .'/editors/'.$option->value, null, false, false)
			||	$lang->load('plg_editors_'.$option->value, JPATH_ADMINISTRATOR, $lang->getDefault(), false, false)
			||	$lang->load('plg_editors_'.$option->value, JPATH_PLUGINS .'/editors/'.$option->value, $lang->getDefault(), false, false);
			$options[$i]->text = JText::_($option->text);
		}

		// Check for a database error.
		if ($db->getErrorNum()) {
			JError::raiseWarning(500, $db->getErrorMsg());
		}

		// Merge any additional options in the XML definition.
		$options = array_merge(parent::getOptions(), $options);

		return $options;
	}
开发者ID:realityking,项目名称:JAJAX,代码行数:41,代码来源:editors.php


示例8: getOptions

 public function getOptions()
 {
     # The options available are based on what type was selected
     $options = array();
     $type = $this->form->getField('entity_type')->value;
     return array_merge(parent::getOptions(), JFormFieldParentEntity::getParents($type));
 }
开发者ID:acculitx,项目名称:fleetmatrixsite,代码行数:7,代码来源:parententity.php


示例9: 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


示例10: getOptions

 /**
  * Method to get a list of options for a list input.
  *
  * @return      array           An array of JHtml options.
  */
 protected function getOptions()
 {
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select($db->quoteName('car.id') . ', ' . $db->quoteName('car.name'));
     $query->from($db->quoteName('#__agendadirigentes_cargos', 'car'));
     if ($this->getAttribute('includecategory', false) == true) {
         $query->select($db->quoteName('cat.title', 'category_name'));
         $query->join('INNER', $db->quoteName('#__categories', 'cat') . ' ON ' . $db->quoteName('car.catid') . ' = ' . $db->quoteName('cat.id'));
         $query->order($db->quoteName('cat.title') . 'ASC, ' . $db->quoteName('car.name') . ' ASC');
     } else {
         $query->order($db->quoteName('car.name') . ' ASC');
     }
     $db->setQuery((string) $query);
     $cargos = $db->loadObjectList();
     $options = array();
     $options[] = JHtml::_('select.option', '', JText::_('COM_AGENDADIRIGENTES_SELECT_CARGO'));
     if ($cargos) {
         foreach ($cargos as $cargo) {
             if ($this->getAttribute('includecategory', false)) {
                 $options[] = JHtml::_('select.option', $cargo->id, $cargo->category_name . ' - ' . $cargo->name);
             } else {
                 $options[] = JHtml::_('select.option', $cargo->id, $cargo->name);
             }
         }
     }
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
开发者ID:VierlingMt,项目名称:joomla-3.x,代码行数:34,代码来源:cargo.php


示例11: getOptions

 protected function getOptions()
 {
     $session = JFactory::getSession();
     $attr = '';
     // Initialize some field attributes.
     $attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
     // To avoid user's confusion, readonly="true" should imply disabled="true".
     if ((string) $this->element['readonly'] == 'true' || (string) $this->element['disabled'] == 'true') {
         $attr .= ' disabled="disabled"';
     }
     //
     $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
     $attr .= $this->multiple ? ' multiple="multiple"' : '';
     // Initialize JavaScript field attributes.
     $attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
     $db = JFactory::getDBO();
     $db->setQuery("SELECT t.name AS name, t.id AS id FROM #__k2_tags AS t WHERE published = 1 ORDER BY t.name ASC");
     $results = $db->loadObjectList();
     $tags = array();
     if (count($results)) {
         foreach ($results as $tag) {
             $tags[] = JHtml::_('select.option', $tag->id, $tag->name);
         }
         $tags = array_merge(parent::getOptions(), $tags);
         return $tags;
     } else {
         $tags = array();
         return $tags;
     }
 }
开发者ID:grchis,项目名称:Site-Auto,代码行数:30,代码来源:k2tags.php


示例12: getOptions

 /**
  * Method to get the options to populate list
  *
  * @return  array  The field option objects.
  *
  * @since   3.2
  */
 protected function getOptions()
 {
     // Hash for caching
     $hash = md5($this->element);
     if (!isset(static::$options[$hash])) {
         static::$options[$hash] = parent::getOptions();
         $options = array();
         $db = JFactory::getDbo();
         $user = JFactory::getUser();
         $query = $db->getQuery(true)->select('a.id AS value')->select('a.title AS text')->select('COUNT(DISTINCT b.id) AS level')->from('#__categories as a')->where('a.extension = "' . $this->extension . '"')->join('LEFT', '#__categories AS b ON a.lft > b.lft AND a.rgt < b.rgt')->group('a.id, a.title, a.lft, a.rgt')->order('a.lft ASC');
         $isRoot = $user->authorise('core.admin');
         if (!$isRoot) {
             require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/imc.php';
             $allowed_catids = ImcHelper::getCategoriesByUserGroups();
             $allowed_catids = implode(',', $allowed_catids);
             if (!empty($allowed_catids)) {
                 $query->where('a.id IN (' . $allowed_catids . ')');
             }
         }
         $db->setQuery($query);
         if ($options = $db->loadObjectList()) {
             foreach ($options as &$option) {
                 $option->text = str_repeat('- ', $option->level) . $option->text;
             }
             static::$options[$hash] = array_merge(static::$options[$hash], $options);
         }
     }
     return static::$options[$hash];
 }
开发者ID:Ricardolau,项目名称:imc,代码行数:36,代码来源:aclcategory.php


示例13: getOptions

 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  * @since   1.6
  */
 protected function getOptions()
 {
     $options = array();
     $db = JFactory::getDbo();
     $query = $db->getQuery(true)->select('a.id AS value, a.name AS text, a.level')->from('#__jdeveloper_forms AS a')->join('LEFT', $db->quoteName('#__jdeveloper_forms') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt')->where('a.parent_id > 0');
     // Prevent parenting to children of this item.
     if ($id = $this->form->getValue('id')) {
         $query->join('LEFT', $db->quoteName('#__jdeveloper_forms') . ' AS p ON p.id = ' . (int) $id)->where('NOT(a.lft >= p.lft AND a.rgt <= p.rgt)');
     }
     $query->group('a.id, a.name, a.level, a.lft, a.rgt, a.parent_id');
     $query->order('a.lft ASC');
     // Get the options.
     $db->setQuery($query);
     try {
         $root = new JObject(array("value" => 1, "text" => JText::_("JGLOBAL_ROOT_PARENT"), "level" => 0));
         $options = array_merge(array($root), $db->loadObjectList());
     } catch (RuntimeException $e) {
         throw new Exception($e->getMessage());
     }
     // Pad the option text with spaces using depth level as a multiplier.
     for ($i = 0, $n = count($options); $i < $n; $i++) {
         $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text;
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:33,代码来源:formparent.php


示例14: getOptions

 function getOptions()
 {
     // Base name of the HTML control.
     //    $ctrl  = $control_name .'['. $name .']';
     $courses = JoomdleHelperContent::getCourseList(0);
     // Construct an array of the HTML OPTION statements.
     $options = array();
     $c = array();
     foreach ($courses as $course) {
         $val = $course['remoteid'];
         $text = $course['fullname'];
         $options[] = JHtml::_('select.option', $val, $text);
         //		$op->id = $course['remoteid'];
         //		$op->text = $course['fullname'];
         //		$c[] = $op;
     }
     $options = array_merge(parent::getOptions(), $options);
     return $options;
     // Construct the various argument calls that are supported.
     $attribs = ' ';
     if ($v = $node->attributes('size')) {
         $attribs .= 'size="' . $v . '"';
     }
     if ($v = $node->attributes('class')) {
         $attribs .= 'class="' . $v . '"';
     } else {
         $attribs .= 'class="inputbox"';
     }
     if ($m = $node->attributes('multiple')) {
         $attribs .= ' multiple="multiple"';
         $ctrl .= '[]';
     }
     // Render the HTML SELECT list.
     return JHTML::_('select.genericlist', $options, $ctrl, $attribs, 'value', 'text', $value, $control_name . $name);
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:35,代码来源:courselist.php


示例15: getInput

 /**
  * Method to get the field input markup with an image tag.
  *
  * @return  string  The field input markup.
  */
 protected function getInput()
 {
     // This Form is used outside of our component, therefor fix the path
     JLoader::import('mapicons', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_simplegeotag' . DS . 'models');
     $model = JModel::getInstance('MapIcons', 'SimpleGeoTagModel');
     $this->items = $model->getItems();
     //var_dump($this->items);
     // Add Google Map's js
     $doc =& JFactory::getDocument();
     /*
     $lang = & JFactory::getLanguage();
     $langcode = $lang->getTag();
     $doc->addScript('http://maps.google.com/maps/api/js?sensor=false&language='.$langcode );
     */
     // Add data to javascript array (for image preview)
     $js = array();
     $js[] = "var mapicons = ";
     $js[] = json_encode($this->items);
     $js[] = ";\n";
     $js[] = "function setMapIcon (val) {\n";
     $js[] = "\tvar mapicon = mapicons.filter(function(item, index, arr) { if(item[\"id\"] == val) return true;  },val)[0];\n";
     $js[] = "\tvar imgtag = \$('jform_metadata_mapicon_img')\n";
     $js[] = "\timgtag.src = mapicon['image'];\n";
     $js[] = "\timgtag.width = mapicon['size_width'];\n";
     $js[] = "\timgtag.height = mapicon['size_height'];\n";
     $js[] = "}\n";
     $doc->addScriptDeclaration(implode($js));
     $this->element['onchange'] = "setMapIcon(this.value)";
     $html = parent::getInput();
     $this->imgid = $this->id . '_' . $this->imgid;
     $html = $html . '<img id="' . $this->imgid . '" src="" />';
     return $html;
 }
开发者ID:beingsane,项目名称:SimpleGeoTag,代码行数:38,代码来源:mapicon.php


示例16: getOptions

 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  * @since   1.6
  */
 protected function getOptions()
 {
     $options = array();
     $db = JFactory::getDbo();
     $query = $db->getQuery(true)->select('a.id AS value, a.title AS text, a.level')->from('#__menu AS a')->join('LEFT', $db->quoteName('#__menu') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt');
     if ($menuType = $this->form->getValue('menutype')) {
         $query->where('a.menutype = ' . $db->quote($menuType));
     } else {
         $query->where('a.menutype != ' . $db->quote(''));
     }
     // Prevent parenting to children of this item.
     if ($id = $this->form->getValue('id')) {
         $query->join('LEFT', $db->quoteName('#__menu') . ' AS p ON p.id = ' . (int) $id)->where('NOT(a.lft >= p.lft AND a.rgt <= p.rgt)');
     }
     $query->where('a.published != -2')->group('a.id, a.title, a.level, a.lft, a.rgt, a.menutype, a.parent_id, a.published')->order('a.lft ASC');
     // Get the options.
     $db->setQuery($query);
     try {
         $options = $db->loadObjectList();
     } catch (RuntimeException $e) {
         JError::raiseWarning(500, $e->getMessage());
     }
     // Pad the option text with spaces using depth level as a multiplier.
     for ($i = 0, $n = count($options); $i < $n; $i++) {
         $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text;
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:36,代码来源:menuparent.php


示例17: getOptions

 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  *
  * @since   1.6
  */
 protected function getOptions()
 {
     $app = JFactory::getApplication();
     // Detect the native language.
     $native = JLanguageHelper::detectLanguage();
     if (empty($native)) {
         $native = 'en-GB';
     }
     // Get a forced language if it exists.
     $forced = $app->getLocalise();
     if (!empty($forced['language'])) {
         $native = $forced['language'];
     }
     // If a language is already set in the session, use this instead
     $model = new InstallationModelSetup();
     $options = $model->getOptions();
     if (isset($options['language'])) {
         $native = $options['language'];
     }
     // Get the list of available languages.
     $options = JLanguageHelper::createLanguageList($native);
     if (!$options || $options instanceof Exception) {
         $options = array();
     } else {
         usort($options, array($this, '_sortLanguages'));
     }
     // Set the default value from the native language.
     $this->value = $native;
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
开发者ID:Tommar,项目名称:remate,代码行数:39,代码来源:language.php


示例18: getOptions

 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  *
  * @since   11.1
  */
 protected function getOptions()
 {
     // Initialize variables.
     $options = array();
     // Initialize some field attributes.
     $filter = (string) $this->element['filter'];
     $exclude = (string) $this->element['exclude'];
     $hideNone = (string) $this->element['hide_none'];
     $hideDefault = (string) $this->element['hide_default'];
     // Get the path in which to search for file options.
     $path = JPATH_ROOT . '/components/com_joomleague/extensions';
     if (!is_dir($path)) {
         $path = JPATH_ROOT . '/' . $path;
     }
     // Get a list of folders in the search path with the given filter.
     $folders = JFolder::folders($path, $filter);
     // Build the options list from the list of folders.
     if (is_array($folders)) {
         foreach ($folders as $folder) {
             // Check to see if the file is in the exclude mask.
             if ($exclude) {
                 if (preg_match(chr(1) . $exclude . chr(1), $folder)) {
                     continue;
                 }
             }
             $options[] = JHtml::_('select.option', $folder, $folder);
         }
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
开发者ID:santas156,项目名称:joomleague-2-komplettpaket,代码行数:39,代码来源:extensionlist.php


示例19: getOptions

	/**
	 * Method to get a list of options for a list input.
	 *
	 * @return  array  An array of JHtml options.
	 */
	protected function getOptions()
	{
		$db    = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select('#__helloworld.id as id,greeting,#__categories.title as category,catid');
		$query->from('#__helloworld');
		$query->leftJoin('#__categories on catid=#__categories.id');
		// Retrieve only published items
		$query->where('#__helloworld.published = 1');
		$db->setQuery((string) $query);
		$messages = $db->loadObjectList();
		$options  = array();

		if ($messages)
		{
			foreach ($messages as $message)
			{
				$options[] = JHtml::_('select.option', $message->id, $message->greeting .
				                      ($message->catid ? ' (' . $message->category . ')' : ''));
			}
		}

		$options = array_merge(parent::getOptions(), $options);

		return $options;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:31,代码来源:helloworld.php


示例20: getOptions

 /**
  * Method to get a list of options for a list input.
  *
  * @return array An array of JHtml options.
  */
 protected function getOptions()
 {
     $current_category_id = JRequest::getInt('id', '0');
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select('`id`, `categoryname`, `parentid`');
     $query->from('#__youtubegallery_categories');
     $db->setQuery((string) $query);
     $messages = $db->loadObjectList();
     if (!$db->query()) {
         die($db->stderr());
     }
     $options = array();
     $options[] = JHtml::_('select.option', 0, JText::_('COM_YOUTUBEGALLERY_SELECT_CATEGORYROOT'));
     $children = $this->getAllChildren($current_category_id);
     if ($messages) {
         foreach ($messages as $message) {
             if ($current_category_id == 0) {
                 $options[] = JHtml::_('select.option', $message->id, $message->categoryname);
             } else {
                 if ($message->id != $current_category_id and $message->parentid != $current_category_id and !in_array($message->id, $children)) {
                     $options[] = JHtml::_('select.option', $message->id, $message->categoryname);
                 }
             }
         }
     }
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
开发者ID:carloslimasis,项目名称:joomla-3.x,代码行数:34,代码来源:categoryparent.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP JFormFieldText类代码示例发布时间:2022-05-23
下一篇:
PHP JFormFieldGroupedList类代码示例发布时间: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