/** * Method to load, setup and return a JFormField object based on field data. * * @param string $element The XML element object representation of the form field. * @param string $group The optional dot-separated form group path on which to find the field. * @param mixed $value The optional value to use as the default for the field. * * @return mixed The JFormField object for the field or boolean false on error. * * @since 11.1 */ protected function loadField($element, $group = null, $value = null) { // Get the field type. $type = $element['type'] ? (string) $element['type'] : 'text'; // Load the JFormField object for the field. /** @var $field JFormField */ $field = JFormHelper::loadFieldType($type, true); // If the object could not be loaded, get a text field object. if ($field === false) { $field = JFormHelper::loadFieldType('text', true); } // Get the value for the form field if not set. // Default to the translated version of the 'default' attribute // if 'translate_default' attribute if set to 'true' or '1' // else the value of the 'default' attribute for the field. if ($value === null) { $default = (string) $element['default']; if (($translate = $element['translate_default']) && ((string) $translate == 'true' || (string) $translate == '1')) { $lang = JFactory::getLanguage(); if ($lang->hasKey($default)) { $debug = $lang->setDebug(false); $default = JText::_($default); $lang->setDebug($debug); } else { $default = JText::_($default); } } } if ($field->setup($element, $value, $group)) { return $field; } else { return false; } }
function renderInput($values = null, $options = array()) { if (!$this->_isCompatible) { return ''; } $tags = array(); if (!empty($values)) { foreach ($values as $v) { if (is_object($v)) { $tags[] = $v->tag_id; } else { $tags[] = (int) $v; } } } if (empty($options['name'])) { $options['name'] = 'tags'; } if (empty($options['mode'])) { $options['mode'] = 'ajax'; } if (!isset($options['class'])) { $options['class'] = 'inputbox span12 small'; } if (!isset($options['multiple'])) { $options['multiple'] = true; } $xmlConf = new SimpleXMLElement('<field name="' . $options['name'] . '" type="tag" mode="' . $options['mode'] . '" label="" class="' . $options['class'] . '" multiple="' . ($options['multiple'] ? 'true' : 'false') . '"></field>'); JFormHelper::loadFieldClass('tag'); $jform = new JForm('hikashop'); $fieldTag = new JFormFieldTag(); $fieldTag->setForm($jform); $fieldTag->setup($xmlConf, $tags); return $fieldTag->input; }
public function getField($type, $attributes = array(), $field_value = '') { static $types = null; $defaults = array('name' => '', 'id' => ''); if (!$types) { jimport('joomla.form.helper'); $types = array(); } if (!in_array($type, $types)) { JFormHelper::loadFieldClass($type); } try { $attributes = array_merge($defaults, $attributes); $xml = new JXMLElement('<?xml version="1.0" encoding="utf-8"?><field />'); foreach ($attributes as $key => $value) { if ('_options' == $key) { foreach ($value as $_opt_value) { $xml->addChild('option', $_opt_value->text)->addAttribute('value', $_opt_value->value); } continue; } $xml->addAttribute($key, $value); } $class = 'JFormField' . $type; $field = new $class(); $field->setup($xml, $field_value); return $field; } catch (Exception $e) { return false; } }
public static function createStatuses() { $app = JFactory::getApplication(); $filter_steps = $app->getUserStateFromRequest('com_imc.issues.filter.steps', 'steps', array()); //get issue statuses JFormHelper::addFieldPath(JPATH_ROOT . '/components/com_imc/models/fields'); $step = JFormHelper::loadFieldType('Step', false); $statuses = $step->getOptions(); if (empty($filter_steps)) { $str = '<ul class="imc_ulist imc_ulist_inline">'; foreach ($statuses as $status) { $str .= '<li>'; $str .= '<input type="checkbox" name="steps[]" value="' . $status->value . '" ' . 'checked="checked"' . '>'; $str .= '<span class="root">' . ' ' . $status->text . '</span>'; $str .= '</li>'; } $str .= '</ul>'; } else { $str = '<ul class="imc_ulist imc_ulist_inline">'; foreach ($statuses as $status) { $str .= '<li>'; $str .= '<input type="checkbox" name="steps[]" value="' . $status->value . '" ' . (in_array($status->value, $filter_steps) ? 'checked="checked"' : '') . '>'; $str .= '<span class="root">' . ' ' . $status->text . '</span>'; $str .= '</li>'; } $str .= '</ul>'; } return $str; }
function display($tpl = null) { JFormHelper::addFormPath(JPATH_ADMINISTRATOR . '/components/com_j2store/models/forms'); JFormHelper::addFieldPath(JPATH_ADMINISTRATOR . '/components/com_j2store/models/fields'); $this->form = JForm::getInstance('storeprofile', 'storeprofile'); $this->addToolBar(); parent::display(); }
/** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { // use as type here the default basic data field type (as example: Text/Calendar/Textarea/Editor) // see http://docs.joomla.org/Standard_form_field_types $field = JFormHelper::loadFieldType('Calendar'); $field->setForm($this->form); $field->setup($this->element, $this->value); return $field->getInput(); }
/** * display method of Cp view * @return void **/ function display($tpl = null) { // Initialiase variables. $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } JRequest::setVar('hidemainmenu', true); $user = JFactory::getUser(); $isNew = empty($this->item->product_id); $document = JFactory::getDocument(); if (JRequest::getVar('tmpl', '') != 'component') { $document->addScript(JURI::base(true) . '/components/com_cp/assets/js/jquery-1.10.1.min.js'); $document->addScriptDeclaration('jQuery.noConflict();'); $document->addScript(JURI::base(true) . '/components/com_cp/assets/js/jquery-ui-1.10.3.custom.min.js'); $document->addScript(JURI::base(true) . '/components/com_cp/assets/js/scripts.js'); $document->addStyleSheet(JURI::base(true) . '/components/com_cp/assets/css/style.css'); $document->addStyleSheet(JURI::base(true) . '/components/com_cp/assets/css/smoothness/jquery-ui-1.8.21.custom.css'); $document->addStyleDeclaration('body { min-width: 1170px; }'); } // Create the form JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); $text = $isNew ? JText::_('COM_CP_NEW') : JText::_('COM_CP_EDIT'); JToolBarHelper::title($text . ' ' . JText::_('COM_CP_PRODUCT_PAGE_TITLE')); if ($isNew && $user->authorise('core.create', 'com_cp')) { JToolBarHelper::apply('cpproducts.apply'); JToolBarHelper::save('cpproducts.save'); JToolBarHelper::save2new('cpproducts.save2new'); JToolBarHelper::cancel('cpproducts.cancel'); } else { if ($user->authorise('core.edit', 'com_cp')) { JToolBarHelper::apply('cpproducts.apply'); JToolBarHelper::save('cpproducts.save'); if ($user->authorise('core.edit', 'com_cp')) { JToolBarHelper::save2new('cpproducts.save2new'); } JToolBarHelper::cancel('cpproducts.cancel', 'COM_CP_CLOSE'); } } $helper = new CPHelper(); if ($isNew) { $countFiles = 0; } else { $countFiles = count($this->item->media); } // Initialize media files script $document->addScriptDeclaration('var mediaCount = ' . $countFiles . '; var delText = "' . JText::_('COM_CP_DELETE') . '"; var siteURL = "' . JURI::root() . '";'); $params = JComponentHelper::getParams('com_cp'); $this->assignRef('params', $params); $this->item->cities = $helper->listCities($this->item->country_code, $this->item->city, 'jform[city]', 'jform_city'); parent::display($tpl); }
public function __construct(&$subject, $config) { if (!class_exists('joomlamailerMCAPI')) { return; } parent::__construct($subject, $config); JFormHelper::addFieldPath(__DIR__ . '/fields'); $this->api = $this->getApiInstance(); $this->debug = JFactory::getConfig()->get('debug'); $this->listId = $this->params->get('listid'); }
protected function populateState($ordering = null, $direction = null) { $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); $published = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'string'); $this->setState('filter.state', $published); JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); $catID = $this->getUserStateFromRequest($this->context . '.filter.category', 'filter_category'); $this->setState('filter.category', $catID); $visibility = $this->getUserStateFromRequest($this->context . '.filter.visibility', 'filter_visibility'); $this->setState('filter.category', $visibility); parent::populateState('a.ordering', 'asc'); }
function displayAll($id, $map, $color) { if (HIKASHOP_J25) { $xmlConf = new SimpleXMLElement('<field name="' . $map . '" type="color" label=""></field>'); JFormHelper::loadFieldClass('color'); $jform = new JForm('hikashop'); $fieldTag = new JFormFieldColor(); $fieldTag->setForm($jform); $fieldTag->setup($xmlConf, $color); return $fieldTag->input; } $code = '<input type="text" name="' . $map . '" id="color' . $id . '" onchange=\'applyColorExample' . $id . '()\' class="inputbox" size="10" value="' . $color . '" />' . ' <input size="10" maxlength="0" style=\'cursor:pointer;background-color:' . $color . '\' onclick="if(document.getElementById(\'colordiv' . $id . '\').style.display == \'block\'){document.getElementById(\'colordiv' . $id . '\').style.display = \'none\';}else{document.getElementById(\'colordiv' . $id . '\').style.display = \'block\';}" id=\'colorexample' . $id . '\' />' . '<div id=\'colordiv' . $id . '\' style=\'display:none;position:absolute;background-color:white;border:1px solid grey;z-index:999\'>' . $this->display($id) . '</div>'; return $code; }
/** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { global $jlistConfig; $app = JFactory::getApplication(); JHtml::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/helpers'); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); $field = JFormHelper::loadFieldType('Text'); $field->setForm($this->form); if ($this->value != '') { $field->setup($this->element, $this->value); } else { $field->setup($this->element, htmlspecialchars(trim($jlistConfig['custom.field.10.values']), ENT_COMPAT, 'UTF-8')); } return $field->getInput(); }
/** * Method to get the HTML of a certain field * * @param null * @return string */ public static function getField($type, $name, $value = null, $array = 'magebridge') { jimport('joomla.form.helper'); jimport('joomla.form.form'); $fileType = preg_replace('/^magebridge\\./', '', $type); include_once JPATH_ADMINISTRATOR . '/components/com_magebridge/fields/' . $fileType . '.php'; $form = new JForm('magebridge'); $field = JFormHelper::loadFieldType($type); if (is_object($field) == false) { $message = JText::sprintf('COM_MAGEBRIDGE_UNKNOWN_FIELD', $type); JFactory::getApplication()->enqueueMessage($message, 'error'); return null; } $field->setName($name); $field->setValue($value); return $field->getHtmlInput(); }
/** * Method to register custom library. * * @return void */ public function onAfterInitialise() { if (!$this->isRedcoreComponent()) { return; } $redcoreLoader = JPATH_LIBRARIES . '/redcore/bootstrap.php'; if (file_exists($redcoreLoader)) { require_once $redcoreLoader; // For Joomla! 2.5 compatibility we add some core functions if (version_compare(JVERSION, '3.0', '<')) { RLoader::registerPrefix('J', JPATH_LIBRARIES . '/redcore/joomla', false, true); } } // Make available the fields JFormHelper::addFieldPath(JPATH_LIBRARIES . '/redcore/form/fields'); // Make available the rules JFormHelper::addRulePath(JPATH_LIBRARIES . '/redcore/form/rules'); }
function getItems() { $items = array(); foreach ($this->element->children() as $element) { // clone element to make it as field $fdata = preg_replace('/<(\\/?)item(\\s|>)/mi', '<\\1field\\2', $element->asXML()); $felement = new SimpleXMLElement($fdata); $field = JFormHelper::loadFieldType((string) $felement['type']); if ($field === false) { $field = JFormHelper::loadFieldType('text'); } // Setup the JFormField object. $field->setForm($this->form); if ($field->setup($felement, null, $this->group . '.' . $this->fieldname)) { $items[] = $field; } } return $items; }
/** * Method to register custom library. * * @return void */ public function onAfterInitialise() { $isAdmin = JFactory::getApplication()->isAdmin(); if (!$isAdmin || !$this->isRedradComponent()) { return; } $redradLoader = JPATH_LIBRARIES . '/redrad/bootstrap.php'; if (file_exists($redradLoader) && !class_exists('Inflector')) { require_once $redradLoader; // For Joomla! 2.5 compatibility we add some core functions if (version_compare(JVERSION, '3.0', '<')) { RLoader::registerPrefix('J', JPATH_LIBRARIES . '/redrad/joomla', false, true); } } // Make available the fields JFormHelper::addFieldPath(JPATH_LIBRARIES . '/redrad/form/fields'); // Make available the rules JFormHelper::addRulePath(JPATH_LIBRARIES . '/redrad/form/rules'); }
/** * Tests the JForm::__construct method */ public function testConstruct() { $form = new JForm('form1'); $this->assertThat($form->load(JFormDataHelper::$loadFieldDocument), $this->isTrue(), 'Line:' . __LINE__ . ' XML string should load successfully.'); $field = new JFormFieldInspector($form); $this->assertThat($field instanceof JFormField, $this->isTrue(), 'Line:' . __LINE__ . ' The JFormField constuctor should return a JFormField object.'); $this->assertThat($field->getForm(), $this->identicalTo($form), 'Line:' . __LINE__ . ' The internal form should be identical to the variable passed in the contructor.'); // Add custom path. JForm::addFieldPath(__DIR__ . '/_testfields'); JFormHelper::loadFieldType('foo.bar'); $field = new FooFormFieldBar($form); $this->assertEquals($field->type, 'FooBar', 'Line:' . __LINE__ . ' The field type should have been guessed by the constructor.'); JFormHelper::loadFieldType('foo'); $field = new JFormFieldFoo($form); $this->assertEquals($field->type, 'Foo', 'Line:' . __LINE__ . ' The field type should have been guessed by the constructor.'); JFormHelper::loadFieldType('modal_foo'); $field = new JFormFieldModal_Foo($form); $this->assertEquals($field->type, 'Modal_Foo', 'Line:' . __LINE__ . ' The field type should have been guessed by the constructor.'); }
public static function getField($type, $name, $value = null, $array = 'magebridge') { if (MageBridgeHelper::isJoomla15()) { require_once JPATH_ADMINISTRATOR . '/components/com_magebridge/elements/' . $type . '.php'; $fake = null; $class = 'JElement' . ucfirst($type); $object = new $class(); return call_user_func(array($object, 'fetchElement'), $name, $value, $fake, $array); } else { jimport('joomla.form.helper'); jimport('joomla.form.form'); require_once JPATH_ADMINISTRATOR . '/components/com_magebridge/fields/' . $type . '.php'; $form = new JForm('magebridge'); $field = JFormHelper::loadFieldType($type); $field->setName($name); $field->setValue($value); return $field->getHtmlInput(); } }
protected function addToolbar() { $state = $this->get('State'); $canDo = SimplefilemanagerHelper::getActions($state->get('filter.category_id')); $user = JFactory::getUser(); $bar = JToolBar::getInstance('toolbar'); JToolbarHelper::title(JText::_('COM_SIMPLEFILEMANAGER_MANAGER_SIMPLEFILEMANAGERS'), 'file-2'); // User should be authorized to publish at least in a category if ($canDo->get('core.create') && count($user->getAuthorisedCategories('com_simplefilemanager', 'core.create')) > 0) { JToolbarHelper::addNew('simplefilemanager.add'); } if ($canDo->get('core.edit')) { JToolbarHelper::editList('simplefilemanager.edit'); } if ($canDo->get('core.edit.state')) { JToolbarHelper::publish('simplefilemanagers.publish', 'JTOOLBAR_PUBLISH', true); JToolbarHelper::unpublish('simplefilemanagers.unpublish', 'JTOOLBAR_UNPUBLISH', true); JToolbarHelper::archiveList('simplefilemanagers.archive'); JToolbarHelper::checkin('simplefilemanagers.checkin'); } $state = $this->get('State'); if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'simplefilemanagers.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash('simplefilemanagers.trash'); } if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_simplefilemanager'); } JToolBarHelper::help('COM_SIMPLEFILEMANAGER_HELP_VIEW_SIMPLEFILEMANANGERS', false, 'http://www.simplefilemanager.eu/support'); JHtmlSidebar::setAction('index.php?option=com_simplefilemanager&view=simplefilemanagers'); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true)); $this->category = JFormHelper::loadFieldType('catid', false); $this->categoryOptions = $this->category->getOptions(); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category', JHtml::_('select.options', $this->categoryOptions, 'value', 'text', $this->state->get('filter.category'))); $this->visibilityOptions = array(1 => JText::_('COM_SIMPLEFILEMANAGER_VISIBILITY_PUBLIC'), 2 => JText::_('COM_SIMPLEFILEMANAGER_VISIBILITY_REGISTRED'), 3 => JText::_('COM_SIMPLEFILEMANAGER_VISIBILITY_USER'), 4 => JText::_('COM_SIMPLEFILEMANAGER_VISIBILITY_GROUP'), 5 => JText::_('COM_SIMPLEFILEMANAGER_VISIBILITY_AUTHOR')); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_VISIBILITY'), 'filter_visibility', JHtml::_('select.options', $this->visibilityOptions, 'value', 'text', $this->state->get('filter.visibility'))); }
/** * $type, $domId, $value, $options = array(), $formName = null, $disabled = false */ public static function element() { list($type, $domId, $value, $options) = func_get_args(); $options = (array) $options; // Load the JFormField object for the field. JFormHelper::addFieldPath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'models' . DS . 'fields'); $field = JFormHelper::loadFieldType($type, true); // If the object could not be loaded, get a text field object. if ($field === false) { throw new Exception('Cannot load field type ' . $type); } $element = new JXMLElement('<field></field>'); $element->addAttribute('id', $domId); if (!empty($options)) { foreach ($options as $name => $val) { $element->addAttribute($name, $val); } } if (!$field->setup($element, $value, null)) { throw new Exception('Cannot setup field ' . $type); } return $field->input; }
function getItems() { $items = array(); foreach ($this->element->children() as $element) { // clone element to make it as field $fdata = preg_replace('/<(\\/?)item(\\s|>)/mi', '<\\1field\\2', $element->asXML()); // remove cols, rows, size attributes $fdata = preg_replace('/\\s(cols|rows|size)=(\'|")\\d+(\'|")/mi', '', $fdata); // change type text to textarea $fdata = str_replace('type="text"', 'type="textarea"', $fdata); $felement = new JXMLElement($fdata); $field = JFormHelper::loadFieldType((string) $felement['type']); if ($field === false) { $field = $this->loadFieldType('text'); } // Setup the JFormField object. $field->setForm($this->form); if ($field->setup($felement, null, $this->name)) { $items[] = $field; } } return $items; }
<?php /** * @copyright Copyright (C) 2011 Cedric KEIFLIN alias ced1870 * http://www.joomlack.fr * Module Maximenu CK * @license GNU/GPL * */ defined('JPATH_BASE') or die; jimport('joomla.filesystem.file'); jimport('joomla.form.formfield'); JFormHelper::loadFieldClass('cklist'); class JFormFieldCkhikashopcategory extends JFormFieldCklist { protected $type = 'ckhikashopcategory'; protected function getOptions() { // if the component is not installed if (!JFolder::exists(JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_hikashop') OR !JFile::exists(JPATH_ROOT . DS . 'modules' . DS . 'mod_maximenuck' . DS . 'helper_hikashop.php')) { // add the root item $option = new stdClass(); $option->text = JText::_('MOD_MAXIMENUCK_HIKASHOP_NOTFOUND'); $option->value = '0'; $options[] = $option; // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; }
<?php /** * @package Joomla.UnitTest * @subpackage Form * * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ JFormHelper::loadFieldClass('filelist'); /** * Test class for JFormFieldFileList. * * @package Joomla.UnitTest * @subpackage Form * @since 12.1 */ class JFormFieldFileListTest extends TestCase { /** * Test the getInput method. * * @return void * * @since 12.1 */ public function testGetInput() { $form = new JForm('form1'); $this->assertThat($form->load('<form><field name="filelist" type="filelist" directory="modules/mod_finder/tmpl" /></form>'), $this->isTrue(), 'Line:' . __LINE__ . ' XML string should load successfully.'); $field = new JFormFieldFileList($form);
<?php /** * @package Joomla.Administrator * @subpackage com_webgallery * * @copyright Copyright (C) 2012 Asikart. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author Generated by AKHelper - http://asikart.com */ // no direct access defined('_JEXEC') or die; include_once JPATH_ADMINISTRATOR . '/components/com_webgallery/includes/core.php'; JForm::addFieldPath(AKPATH_FORM . '/fields'); JFormHelper::loadFieldClass('Modal'); /** * Supports a modal picker. */ class JFormFieldItem_Modal extends JFormFieldModal { /** * The form field type. * * @var string * @since 1.6 */ protected $type = 'Item_Modal'; /** * List name. * * @var string
<?php /** * @package FrameworkOnFramework * @subpackage form * @subpackage form * @copyright Copyright (C) 2010 - 2012 Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access defined('_JEXEC') or die; JFormHelper::loadFieldClass('usergroup'); /** * Form Field class for F0F * Joomla! user groups * * @package FrameworkOnFramework * @since 2.0 */ class F0FFormFieldUsergroup extends JFormFieldUsergroup implements F0FFormField { protected $static; protected $repeatable; /** @var int A monotonically increasing number, denoting the row number in a repeatable view */ public $rowid; /** @var F0FTable The item being rendered in a repeatable form field */ public $item; /** * Method to get certain otherwise inaccessible properties from the form field object. * * @param string $name The property name for which to the the value.
<?php /** *------------------------------------------------------------------------------ * @package CANVAS Framework for Joomla! *------------------------------------------------------------------------------ * @copyright Copyright (C) 2004-2013 ThemezArt.com. All Rights Reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @authors ThemezArt * & t3-framework.org as base version * @Link: http://themezart.com/canvas-framework *------------------------------------------------------------------------------ */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('hidden'); // Import the com_menus helper. require_once realpath(JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); /** * Supports an HTML select list of menus * * @package Joomla.Libraries * @subpackage Form * @since 1.6 */ class JFormFieldCANVASMegaMenu extends JFormFieldHidden { /** * The form field type. * * @var string * @since 1.6
/** * Constructor. * * @param object &$subject The object to observe * @param array $config An array that holds the plugin configuration * * @since 1.0.0 */ public function __construct(&$subject, $config) { parent::__construct($subject, $config); JFormHelper::addFieldPath(__DIR__ . '/fields'); }
<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('groupedlist'); /** * Form Field class for the Joomla CMS. * Supports a select grouped list of template styles * * @package Joomla.Libraries * @subpackage Form * @since 1.6 */ class JFormFieldTemplatestyle extends JFormFieldGroupedList { /** * The form field type. * * @var string * @since 1.6 */ public $type = 'TemplateStyle'; /** * Method to get the list of template style options * grouped by template.
* ------------------------------------------------------------------------ * JUDirectory for Joomla 2.5, 3.x * ------------------------------------------------------------------------ * * @copyright Copyright (C) 2010-2015 JoomUltra Co., Ltd. All Rights Reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author JoomUltra Co., Ltd * @website http://www.joomultra.com * @----------------------------------------------------------------------@ */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); jimport('joomla.html.html'); jimport('joomla.form.formfield'); jimport('joomla.form.helper'); JFormHelper::loadFieldClass('checkboxes'); class JFormFieldCategoriesAssignment extends JFormFieldCheckboxes { protected $type = 'CategoriesAssignment'; protected function getInput() { $class = $this->element['class'] ? ' class="checkboxes ' . (string) $this->element['class'] . '"' : ' class="checkboxes"'; $html = '<fieldset id="' . $this->id . '"' . $class . '>'; $html .= '<div class="btn-group pull-left">'; $html .= '<button type="button" class="btn btn-mini" onclick="jQuery(\'.assigned_cat\').each(function(el) { jQuery(this).prop(\'checked\', !jQuery(this).is(\':checked\')); });">'; $html .= JText::_('JGLOBAL_SELECTION_INVERT') . '</button>'; $html .= '<button type="button" class="btn btn-mini" onclick="jQuery(\'.assigned_cat\').each(function(el) { jQuery(this).prop(\'checked\', false); });">'; $html .= JText::_('JGLOBAL_SELECTION_NONE') . '</button>'; $html .= '<button type="button" class="btn btn-mini" onclick="jQuery(\'.assigned_cat\').each(function(el) { jQuery(this).prop(\'checked\', true); });">'; $html .= JText::_('JGLOBAL_SELECTION_ALL') . '</button>'; $html .= '</div>';
<?php jimport('joomla.form.helper'); JFormHelper::loadFieldClass('calendar'); class JFormFieldYearMonth extends JFormFieldCalendar { /** * Method to get the field input markup. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { // Translate placeholder text $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; // Initialize some field attributes. $format = $this->format; // Build shared the attributes array. $attributes = array(); empty($this->class) ? null : ($attributes['class'] = $this->class); !$this->readonly ? null : ($attributes['readonly'] = 'readonly'); !$this->disabled ? null : ($attributes['disabled'] = 'disabled'); empty($this->onchange) ? null : ($attributes['onchange'] = $this->onchange); empty($hint) ? null : ($attributes['placeholder'] = $hint); if ($this->required) { $attributes['required'] = ''; $attributes['aria-required'] = 'true'; } // Parse 'NOW' to current time
<?php /** * @package FrameworkOnFramework * @copyright Copyright (C) 2010 - 2012 Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access defined('_JEXEC') or die; JFormHelper::loadFieldClass('text'); /** * Form Field class for the FOF framework * Supports a one line text field. * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormFieldText extends JFormFieldText implements FOFFormField { protected $static; protected $repeatable; /** @var FOFTable The item being rendered in a repeatable form field */ public $item; /** @var int A monotonically increasing number, denoting the row number in a repeatable view */ public $rowid; /** * Method to get certain otherwise inaccessible properties from the form field object. * * @param string $name The property name for which to the the value. * * @return mixed The property value or null.