當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ElementHelper類代碼示例

本文整理匯總了PHP中ElementHelper的典型用法代碼示例。如果您正苦於以下問題:PHP ElementHelper類的具體用法?PHP ElementHelper怎麽用?PHP ElementHelper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ElementHelper類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     $js = "onclick=\"setAllCheckBoxes('details[hidden]', this.checked);\"";
     $chk = $value == '1' ? ' checked="checked"' : '';
     $fullName = ElementHelper::getFullName($this, $control_name, $name);
     return "<input {$js} id=\"{$control_name}{$name}\" type=\"checkbox\" name=\"" . $fullName . "\" value=\"1\" {$chk} />";
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:7,代碼來源:hidden.php

示例2: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     $fullName = ElementHelper::getFullName($this, $control_name, $name);
     $opts[] = JHTML::_('select.option', "ASC", JText::_('ASCENDING'));
     $opts[] = JHTML::_('select.option', "DESC", JText::_('DESCENDING'));
     return JHTML::_('select.genericlist', $opts, $fullName, 'class="inputbox" size="1"', 'value', 'text', $value);
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:7,代碼來源:ascendingdescending.php

示例3: getUrl

 /**
  * Returns the element's full URL.
  *
  * @return string
  */
 public function getUrl()
 {
     if ($this->uri === null) {
         ElementHelper::setUniqueUri($this);
     }
     return parent::getUrl();
 }
開發者ID:kentonquatman,項目名稱:portfolio,代碼行數:12,代碼來源:BaseEntryRevisionModel.php

示例4: safeUp

 public function safeUp()
 {
     //First get all option types and values and make dropdown fields
     $alloptionTypes = craft()->db->createCommand()->select('*')->from('market_optiontypes')->queryAll();
     $fields = [];
     foreach ($alloptionTypes as $optionType) {
         // Need to know if the field name is already taken
         $exists = craft()->fields->getFieldByHandle(ElementHelper::createSlug($optionType['handle']));
         //make a new field name is field name already taken
         if ($exists && $exists->id) {
             $optionType['handle'] = $optionType['handle'] . " option";
         }
         //Make a new field
         $field = new FieldModel();
         $field->groupId = 1;
         $field->context = 'global';
         $field->name = $optionType['name'];
         $field->handle = ElementHelper::createSlug($optionType['handle']);
         $field->type = "Dropdown";
         // Add the values
         $optionValues = craft()->db->createCommand()->select('*')->from('market_optionvalues')->where('optionTypeId=:id', [':id' => $optionType['id']])->queryAll();
         $options = [];
         foreach ($optionValues as $ov) {
             $value = ['label' => $ov['displayName'], 'value' => $ov['name']];
             $options['options'][] = $value;
         }
         $field->settings = $options;
         //save the field
         craft()->fields->saveField($field);
         $fields[] = $field;
     }
     return true;
 }
開發者ID:aladrach,項目名稱:Bluefoot-Craft-Starter,代碼行數:33,代碼來源:m150616_010101_Market_OptionTypesToFieldsOnVariant.php

示例5: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     $id = ElementHelper::getId($this, $control_name, $name);
     $fullName = ElementHelper::getFullName($this, $control_name, $name);
     $iframeid = $id . '_iframe';
     $cid = JRequest::getVar('cid', array(), 'array');
     // $$$ hugh - when creating a new form, no 'cid' ... not sure what to do, so just set it to 0.  Should
     // prolly just return something like 'available after save' ?
     if (!empty($cid)) {
         $cid = (int) $cid[0];
     } else {
         $cid = 0;
     }
     $c = (int) $this->getRepeatCounter();
     $href = COM_FABRIK_LIVESITE . 'index.php?option=com_fabrik&controller=plugin&task=pluginAjax&plugin=fabriktwitter&g=form&method=authenticateAdmin&tmpl=component&formid=' . $cid . '&repeatCounter=' . $c;
     $clearjs = '$(\'paramstwitter_oauth_token-' . $c . '\').value = \'\';';
     $clearjs .= '$(\'paramstwitter_oauth_token_secret-' . $c . '\').value = \'\';';
     $clearjs .= '$(\'paramstwitter_oauth_user-' . $c . '\').value = \'\';';
     $clearjs .= "return false;";
     $js = "window.open('{$href}', 'twitterwins', 'width=800,height=460,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');return false;";
     $str = '<a href="#" onclick="' . $js . '"><img src="' . COM_FABRIK_LIVESITE . 'components/com_fabrik/libs/abraham-twitteroauth/images/lighter.png" alt="Sign in with Twitter"/></a>';
     $str .= " | <a href=\"#\" onclick=\"{$clearjs}\">" . JText::_('PLG_FORM_TWITTER_CLEAR_CREDENTIALS') . "</a><br/>";
     $str .= "<br /><input type=\"text\" readonly=\"readonly\" name=\"{$fullName}\" id=\"{$id}\" value=\"{$value}\" />";
     return $str;
 }
開發者ID:juliano-hallac,項目名稱:fabrik,代碼行數:25,代碼來源:twittersignin.php

示例6: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     jimport('joomla.filesystem.folder');
     // path to images directory
     $path = JPATH_ROOT . DS . $node->attributes('directory');
     $filter = $node->attributes('filter');
     $exclude = $node->attributes('exclude');
     $recursive = $node->attributes('recursive') == 1 ? true : false;
     $folders = JFolder::folders($path, $filter, $recursive);
     $folders = $this->recursive_listdir($path, $node);
     $options = array();
     foreach ($folders as $key => $folder) {
         if ($exclude) {
             if (preg_match(chr(1) . $exclude . chr(1), $folder)) {
                 continue;
             }
         }
         $options[] = JHTML::_('select.option', $key, $folder);
     }
     if (!$node->attributes('hide_none')) {
         array_unshift($options, JHTML::_('select.option', '-1', '- ' . JText::_('Do not use') . ' -'));
     }
     if (!$node->attributes('hide_default')) {
         array_unshift($options, JHTML::_('select.option', '', '- ' . JText::_('Use default') . ' -'));
     }
     $fullName = ElementHelper::getFullName($this, $control_name, $name);
     return JHTML::_('select.genericlist', $options, $fullName, 'class="inputbox"', 'value', 'text', $value, "params{$name}");
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:28,代碼來源:recursivefolderlist.php

示例7: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     if ($value == '0' || $value == '') {
         $value = '255';
     }
     $fullName = ElementHelper::getFullName($this, $control_name, $name);
     return "<input onblur=\"setAll(this.value, '{$fullName}');\" class=\"inputbox\" type=\"text\" name=\"{$fullName}\" size=\"3\" value=\"{$value}\" />";
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:8,代碼來源:maxlength.php

示例8: render

 public function render($params = array())
 {
     $countries = $this->_data->get('country', array());
     $keys = array_flip($countries);
     $countries = array_intersect_key(self::getCountryArray(), $keys);
     $countries = array_map(create_function('$a', 'return JText::_($a);'), $countries);
     return ElementHelper::applySeparators($params['separated_by'], $countries);
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:8,代碼來源:country.php

示例9: render

 public function render($params = array())
 {
     $linked = isset($params['linked']) && $params['linked'];
     $values = array();
     foreach ($this->_item->getRelatedCategories(true) as $category) {
         $values[] = $linked ? '<a href="' . JRoute::_(RouteHelper::getCategoryRoute($category)) . '">' . $category->name . '</a>' : $category->name;
     }
     return ElementHelper::applySeparators($params['separated_by'], $values);
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:9,代碼來源:itemcategory.php

示例10: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     if ($value == '') {
         $user = JFactory::getUser();
         $value = $user->get('id');
     }
     $fullName = ElementHelper::getFullName($this, $control_name, $name);
     return JHTML::_('list.users', $fullName, $value);
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:9,代碼來源:author.php

示例11: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     $db =& JFactory::getDBO();
     $db->setQuery("SELECT id AS value, label AS `text` FROM #__fabrik_forms order by value DESC");
     $rows = $db->loadObjectList();
     $id = ElementHelper::getId($this, $control_name, $name);
     $fullName = ElementHelper::getFullName($this, $control_name, $name);
     return JHTML::_('select.genericlist', $rows, $fullName, 'class="inputbox"  size="1"', 'value', 'text', $value);
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:9,代碼來源:formlist.php

示例12: render

 public function render($params = array())
 {
     $category_ids = $this->_data->get('category', array());
     $category_links = array();
     $categories = YTable::getInstance('category')->getById($category_ids, true);
     foreach ($categories as $category) {
         $category_links[] = '<a href="' . RouteHelper::getCategoryRoute($category) . '">' . $category->name . '</a>';
     }
     return ElementHelper::applySeparators($params['separated_by'], $category_links);
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:10,代碼來源:relatedcategories.php

示例13: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'image.php';
     $imageLibs = imageHelper::getLibs();
     if (empty($imageLibs)) {
         return JText::_('NO MAGE LIBRARY FOUND');
     }
     $fullName = ElementHelper::getFullName($this, $control_name, $name);
     return JHTML::_('select.genericlist', $imageLibs, $fullName, 'class="inputbox" size="1" ', 'value', 'text', $value);
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:10,代碼來源:imagelibs.php

示例14: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     $a = array(JHTML::_('select.option', '', JText::_('COM_FABRIK_PLEASE_SELECT')));
     $db =& JFactory::getDBO();
     $group = $node->attributes('plugin');
     $db->setQuery("SELECT id AS value, label AS text FROM #__fabrik_visualizations WHERE state ='1' ORDER BY text");
     $elementstypes = $db->loadObjectList();
     $elementstypes = array_merge($a, $elementstypes);
     $fullName = ElementHelper::getFullName($this, $control_name, $name);
     return JHTML::_('select.genericlist', $elementstypes, $fullName, 'class="inputbox elementtype"  size="1"', 'value', 'text', $value);
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:11,代碼來源:visaulizationlist.php

示例15: render

 public function render($params = array())
 {
     $options_from_config = $this->_config->get('options');
     $selected_options = $this->_data->get('option', array());
     $options = array();
     foreach ($options_from_config as $option) {
         if (in_array($option['value'], $selected_options)) {
             $options[] = $option['name'];
         }
     }
     return ElementHelper::applySeparators($params['separated_by'], $options);
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:12,代碼來源:option.php


注:本文中的ElementHelper類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。