protected function getOptions() { global $gantry; $options = array(); $options = parent::getOptions(); $hide_mobile = false; $positions = $gantry->getUniquePositions(); foreach ($positions as $position) { $positionInfo = $gantry->getPositionInfo($position); if ($hide_mobile && $positionInfo->mobile) { continue; } if (1 == (int) $positionInfo->max_positions) { $split_postions[] = $positionInfo->id; continue; } for ($i = 1; $i <= (int) $positionInfo->max_positions; $i++) { $split_postions[] = $positionInfo->id . '-' . chr(96 + $i); } } foreach ($split_postions as $position) { // Create a new option object based on the <option /> element. $tmp = GantryHtmlSelect::option($position, $position, 'value', 'text', false); $options[] = $tmp; } return $options; }
/** * Method to get the field options. * * @return array The field option objects. * @since 1.6 */ protected function getOptions() { // Merge any additional options in the XML definition. global $gantry; $options = parent::getOptions(); $unique = $this->getBool('unique', false); if ($unique) { $positions = $gantry->getUniquePositions(); } else { $positions = $gantry->getPositions(); } $hide_mobile = $this->getBool('hide_mobile', false); $options = array(); foreach ($positions as $position) { $positionInfo = $gantry->getPositionInfo($position); if ($hide_mobile && $positionInfo->mobile) { continue; } $val = $position; $text = $position; $tmp = GantryHtmlSelect::option($val, $text, 'value', 'text', false); $options[] = $tmp; } return $options; }
/** * Method to get the field options. * * @return array The field option objects. * @since 1.6 */ protected function getOptions() { global $gantry; $options = array(); $options = parent::getOptions(); $choices = array("linear", "Quad.easeOut", "Quad.easeIn", "Quad.easeInOut", "Cubic.easeOut", "Cubic.easeIn", "Cubic.easeInOut", "Quart.easeOut", "Quart.easeIn", "Quart.easeInOut", "Quint.easeOut", "Quint.easeIn", "Quint.easeInOut", "Expo.easeOut", "Expo.easeIn", "Expo.easeInOut", "Circ.easeOut", "Circ.easeIn", "Circ.easeInOut", "Sine.easeOut", "Sine.easeIn", "Sine.easeInOut", "Back.easeOut", "Back.easeIn", "Back.easeInOut", "Bounce.easeOut", "Bounce.easeIn", "Bounce.easeInOut", "Elastic.easeOut", "Elastic.easeIn", "Elastic.easeInOut"); foreach ($choices as $choice) { // Create a new option object based on the <option /> element. $tmp = GantryHtmlSelect::option($choice, $choice, 'value', 'text', false); $options[] = $tmp; } return $options; }
/** * Method to get the field options. * * @return array The field option objects. * @since 1.6 */ protected function getOptions() { // Merge any additional options in the XML definition. global $gantry; $options = parent::getOptions(); $menus = JHtml::_('menu.menus'); foreach ($menus as $menu) { // Create a new option object based on the <option /> element. $tmp = GantryHtmlSelect::option($menu->value, $menu->text, 'value', 'text', false); $options[] = $tmp; } return $options; }
protected function getOptions() { global $gantry; $options = array(); $options = parent::getOptions(); if ($this->position_info != null) { if ($this->position_info->max_positions < (int) $this->value) { $gantry->set($this->id, $this->position_info->max_positions); $this->value = $this->position_info->max_positions; } for ($i = 1; $i <= $this->position_info->max_positions; $i++) { // Create a new option object based on the <option /> element. $tmp = GantryHtmlSelect::option($i, $i, 'value', 'text', false); $options[] = $tmp; } } return $options; }
/** * Method to get the field options. * * @return array The field option objects. * @since 1.6 */ public function getOptions() { // Initialize variables. $options = array(); // Initialize some field attributes. $filter = (string) $this->element['filter']; $exclude = (string) $this->element['exclude']; $stripExt = (string) $this->element['stripext']; $hideNone = (string) $this->element['hide_none']; $hideDefault = (string) $this->element['hide_default']; // Get the path in which to search for file options. $path = (string) $this->element['directory']; if (!is_dir($path)) { $path = JPATH_ROOT . '/' . $path; } // Prepend some default options based on field attributes. if (!$hideNone) { $options[] = GantryHtmlSelect::option('-1', JText::alt('JOPTION_DO_NOT_USE', preg_replace('/[^a-zA-Z0-9_\\-]/', '_', $this->fieldname))); } if (!$hideDefault) { $options[] = GantryHtmlSelect::option('', JText::alt('JOPTION_USE_DEFAULT', preg_replace('/[^a-zA-Z0-9_\\-]/', '_', $this->fieldname))); } // Get a list of files in the search path with the given filter. $files = JFolder::files($path, $filter); // Build the options list from the list of files. if (is_array($files)) { foreach ($files as $file) { // Check to see if the file is in the exclude mask. if ($exclude) { if (preg_match(chr(1) . $exclude . chr(1), $file)) { continue; } } // If the extension is to be stripped, do it. if ($stripExt) { $file = JFile::stripExt($file); } $options[] = GantryHtmlSelect::option($file, $file); } } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; }
protected function getOptions() { global $gantry; $options = array(); $options = parent::getOptions(); if (!defined("GANTRY_FONTS")) { $gantry->addScript($gantry->gantryUrl . '/admin/widgets/fonts/js/fonts.js'); $gantry->addDomReadyScript("GantryFonts.init('webfonts_enabled', 'webfonts_source', 'font_family');"); define("GANTRY_FONTS", 1); } // only google right now if ($gantry->get('webfonts-source') == 'google') { $webfonts = $this->_google_fonts; } if ($gantry->get('webfonts-enabled')) { $disabled = false; } else { $disabled = true; } foreach ($webfonts as $webfont) { $webfontsData = $webfont; $webfontsValue = $webfont; $text = $webfontsData; // Create a new option object based on the <option /> element. $tmp = GantryHtmlSelect::option((string) $webfontsValue, JText::_(trim((string) $text)), 'value', 'text', $disabled); // adding reference source class if (in_array($webfont, $this->_google_fonts)) { $option['class'] = 'google'; } else { $option['class'] = 'native'; } // Set some option attributes. $tmp->class = (string) $option['class']; // Set some JavaScript option attributes. $tmp->onclick = isset($option['onclick']) ? (string) $option['onclick'] : ''; // Add the option object to the result set. $options[] = $tmp; } return $options; }
/** * Method to get the field options. * * @return array The field option objects. * @since 1.6 */ protected function getOptions() { // Initialise variables. $options = array(); $extension = $this->element['extension'] ? (string) $this->element['extension'] : (string) $this->element['scope']; $published = (string) $this->element['published']; // Load the category options for a given extension. if (!empty($extension)) { // Filter over published state or not depending upon if it is present. if ($published) { $options = JHtml::_('category.options', $extension, array('filter.published' => explode(',', $published))); } else { $options = JHtml::_('category.options', $extension); } // Verify permissions. If the action attribute is set, then we scan the options. if ($action = (string) $this->element['action']) { // Get the current user object. $user = JFactory::getUser(); foreach ($options as $i => $option) { // To take save or create in a category you need to have create rights for that category // unless the item is already in that category. // Unset the option if the user isn't authorised for it. In this field assets are always categories. if ($user->authorise('core.create', $extension . '.category.' . $option->value) != true) { unset($options[$i]); } } } if (isset($this->element['show_root'])) { array_unshift($options, JHtml::_('select.option', '0', JText::_('-- Select Category --'))); } } else { JError::raiseWarning(500, JText::_('JLIB_FORM_ERROR_FIELDS_CATEGORY_ERROR_EXTENSION_EMPTY')); } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; }