| Current Path : /home/wuectly/www/03cbe/ |
| Current File : /home/wuectly/www/03cbe/form.zip |
PK t!]��\� � field.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Generic interface that a F0F form field class must implement
*
* @package FrameworkOnFramework
* @since 2.0
*/
interface F0FFormField
{
/**
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
*
* @return string The field HTML
*
* @since 2.0
*/
public function getStatic();
/**
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
*
* @return string The field HTML
*
* @since 2.0
*/
public function getRepeatable();
}
PK t!]�� header/published.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Field header for Published (enabled) columns
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderPublished extends F0FFormHeaderFieldselectable
{
/**
* Create objects for the options
*
* @return array The array of option objects
*/
protected function getOptions()
{
$config = array(
'published' => 1,
'unpublished' => 1,
'archived' => 0,
'trash' => 0,
'all' => 0,
);
$stack = array();
if ($this->element['show_published'] == 'false')
{
$config['published'] = 0;
}
if ($this->element['show_unpublished'] == 'false')
{
$config['unpublished'] = 0;
}
if ($this->element['show_archived'] == 'true')
{
$config['archived'] = 1;
}
if ($this->element['show_trash'] == 'true')
{
$config['trash'] = 1;
}
if ($this->element['show_all'] == 'true')
{
$config['all'] = 1;
}
$options = JHtml::_('jgrid.publishedOptions', $config);
reset($options);
return $options;
}
}
PK t!]=C�f�
�
header/fieldsearchable.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Generic field header, with text input (search) filter
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderFieldsearchable extends F0FFormHeaderField
{
/**
* Get the filter field
*
* @return string The HTML
*/
protected function getFilter()
{
// Initialize some field attributes.
$size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
$maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : '';
$filterclass = $this->element['filterclass'] ? ' class="' . (string) $this->element['filterclass'] . '"' : '';
$placeholder = $this->element['placeholder'] ? $this->element['placeholder'] : $this->getLabel();
$name = $this->element['searchfieldname'] ? $this->element['searchfieldname'] : $this->name;
$placeholder = ' placeholder="' . JText::_($placeholder) . '"';
if ($this->element['searchfieldname'])
{
$model = $this->form->getModel();
$searchvalue = $model->getState((string) $this->element['searchfieldname']);
}
else
{
$searchvalue = $this->value;
}
// Initialize JavaScript field attributes.
if ($this->element['onchange'])
{
$onchange = ' onchange="' . (string) $this->element['onchange'] . '"';
}
else
{
$onchange = ' onchange="document.adminForm.submit();"';
}
return '<input type="text" name="' . $name . '" id="' . $this->id . '"' . ' value="'
. htmlspecialchars($searchvalue, ENT_COMPAT, 'UTF-8') . '"' . $filterclass . $size . $placeholder . $onchange . $maxLength . '/>';
}
/**
* Get the buttons HTML code
*
* @return string The HTML
*/
protected function getButtons()
{
$buttonclass = $this->element['buttonclass'] ? (string) $this->element['buttonclass'] : 'btn hasTip hasTooltip';
$buttonsState = strtolower($this->element['buttons']);
$show_buttons = !in_array($buttonsState, array('no', 'false', '0'));
if (!$show_buttons)
{
return '';
}
$html = '';
$html .= '<button class="' . $buttonclass . '" onclick="this.form.submit();" title="' . JText::_('JSEARCH_FILTER') . '" >' . "\n";
$html .= '<i class="icon-search"></i>';
$html .= '</button>' . "\n";
$html .= '<button class="' . $buttonclass . '" onclick="document.adminForm.' . $this->id . '.value=\'\';this.form.submit();" title="' . JText::_('JSEARCH_RESET') . '">' . "\n";
$html .= '<i class="icon-remove"></i>';
$html .= '</button>' . "\n";
return $html;
}
}
PK t!]���g g header/model.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
if (!class_exists('JFormFieldSql'))
{
require_once JPATH_LIBRARIES . '/joomla/form/fields/sql.php';
}
/**
* Form Field class for F0F
* Generic list from a model's results
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderModel extends F0FFormHeaderFieldselectable
{
/**
* Method to get the field options.
*
* @return array The field option objects.
*/
protected function getOptions()
{
$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'];
$applyAccess = $this->element['apply_access'] ? (string) $this->element['apply_access'] : 'false';
$modelName = (string) $this->element['model'];
$nonePlaceholder = (string) $this->element['none'];
$translate = empty($this->element['translate']) ? 'true' : (string) $this->element['translate'];
$translate = in_array(strtolower($translate), array('true','yes','1','on')) ? true : false;
if (!empty($nonePlaceholder))
{
$options[] = JHtml::_('select.option', null, JText::_($nonePlaceholder));
}
// Process field atrtibutes
$applyAccess = strtolower($applyAccess);
$applyAccess = in_array($applyAccess, array('yes', 'on', 'true', '1'));
// Explode model name into model name and prefix
$parts = F0FInflector::explode($modelName);
$mName = ucfirst(array_pop($parts));
$mPrefix = F0FInflector::implode($parts);
// Get the model object
$config = array('savestate' => 0);
$model = F0FModel::getTmpInstance($mName, $mPrefix, $config);
if ($applyAccess)
{
$model->applyAccessFiltering();
}
// Process state variables
foreach ($this->element->children() as $stateoption)
{
// Only add <option /> elements.
if ($stateoption->getName() != 'state')
{
continue;
}
$stateKey = (string) $stateoption['key'];
$stateValue = (string) $stateoption;
$model->setState($stateKey, $stateValue);
}
// Set the query and get the result list.
$items = $model->getItemList(true);
// 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;
}
}
PK t!] ۿM� � header/rowselect.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Row selection checkbox
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderRowselect extends F0FFormHeader
{
/**
* Get the header
*
* @return string The header HTML
*/
protected function getHeader()
{
return '<input type="checkbox" name="checkall-toggle" value="" title="'
. JText::_('JGLOBAL_CHECK_ALL')
. '" onclick="Joomla.checkAll(this)" />';
}
}
PK t!]����
�
header/fieldfilterable.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Generic field header, with text input (search) filter
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderFieldfilterable extends F0FFormHeaderFieldsearchable
{
/**
* Get the filter field
*
* @return string The HTML
*/
protected function getFilter()
{
$valide = array('yes', 'true', '1');
// Initialize some field(s) attributes.
$size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
$maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : '';
$filterclass = $this->element['filterclass'] ? ' class="' . (string) $this->element['filterclass'] . '"' : '';
$placeholder = $this->element['placeholder'] ? $this->element['placeholder'] : $this->getLabel();
$name = $this->element['searchfieldname'] ? $this->element['searchfieldname'] : $this->name;
$placeholder = ' placeholder="' . JText::_($placeholder) . '"';
$single = in_array($this->element['single'], $valide) ? true : false;
$showMethod = in_array($this->element['showmethod'], $valide) ? true : false;
$method = $this->element['method'] ? $this->element['method'] : 'between';
$fromName = $this->element['fromname'] ? $this->element['fromname'] : 'from';
$toName = $this->element['toname'] ? $this->element['toname'] : 'to';
$values = $this->form->getModel()->getState($name);
$fromValue = $values[$fromName];
$toValue = $values[$toName];
// Initialize JavaScript field attributes.
if ($this->element['onchange'])
{
$onchange = ' onchange="' . (string) $this->element['onchange'] . '"';
}
else
{
$onchange = ' onchange="document.adminForm.submit();"';
}
if ($showMethod)
{
$html = '<input type="text" name="' . $name . '[method]" value="'. $method . '" />';
} else
{
$html = '<input type="hidden" name="' . $name . '[method]" value="'. $method . '" />';
}
$html .= '<input type="text" name="' . $name . '[from]" id="' . $this->id . '_' . $fromName . '"' . ' value="'
. htmlspecialchars($fromValue, ENT_COMPAT, 'UTF-8') . '"' . $filterclass . $size . $placeholder . $onchange . $maxLength . '/>';
if (!$single)
{
$html .= '<input type="text" name="' . $name . '[to]" id="' . $this->id . '_' . $toName . '"' . ' value="'
. htmlspecialchars($toValue, ENT_COMPAT, 'UTF-8') . '"' . $filterclass . $size . $placeholder . $onchange . $maxLength . '/>';
}
return $html;
}
}PK t!]�% header/language.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Language field header
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderLanguage extends F0FFormHeaderFieldselectable
{
/**
* Method to get the filter options.
*
* @return array The filter option objects.
*
* @since 2.0
*/
protected function getOptions()
{
// Initialize some field attributes.
$client = (string) $this->element['client'];
if ($client != 'site' && $client != 'administrator')
{
$client = 'site';
}
// Merge any additional options in the XML definition.
$options = array_merge(
parent::getOptions(), JLanguageHelper::createLanguageList($this->value, constant('JPATH_' . strtoupper($client)), true, true)
);
return $options;
}
}
PK t!]���
header/fieldselectable.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Generic field header, with drop down filters
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderFieldselectable extends F0FFormHeaderField
{
/**
* Create objects for the options
*
* @return array The array of option objects
*/
protected function getOptions()
{
$options = array();
// Get the field $options
foreach ($this->element->children() as $option)
{
// Only add <option /> elements.
if ($option->getName() != 'option')
{
continue;
}
// Create a new option object based on the <option /> element.
$options[] = JHtml::_(
'select.option',
(string) $option['value'],
JText::alt(
trim((string) $option),
preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)
),
'value', 'text', ((string) $option['disabled'] == 'true')
);
}
// Do we have a class and method source for our options?
$source_file = empty($this->element['source_file']) ? '' : (string) $this->element['source_file'];
$source_class = empty($this->element['source_class']) ? '' : (string) $this->element['source_class'];
$source_method = empty($this->element['source_method']) ? '' : (string) $this->element['source_method'];
$source_key = empty($this->element['source_key']) ? '*' : (string) $this->element['source_key'];
$source_value = empty($this->element['source_value']) ? '*' : (string) $this->element['source_value'];
$source_translate = empty($this->element['source_translate']) ? 'true' : (string) $this->element['source_translate'];
$source_translate = in_array(strtolower($source_translate), array('true','yes','1','on')) ? true : false;
$source_format = empty($this->element['source_format']) ? '' : (string) $this->element['source_format'];
if ($source_class && $source_method)
{
// Maybe we have to load a file?
if (!empty($source_file))
{
$source_file = F0FTemplateUtils::parsePath($source_file, true);
if (F0FPlatform::getInstance()->getIntegrationObject('filesystem')->fileExists($source_file))
{
include_once $source_file;
}
}
// Make sure the class exists
if (class_exists($source_class, true))
{
// ...and so does the option
if (in_array($source_method, get_class_methods($source_class)))
{
// Get the data from the class
if ($source_format == 'optionsobject')
{
$options = array_merge($options, $source_class::$source_method());
}
else
{
$source_data = $source_class::$source_method();
// Loop through the data and prime the $options array
foreach ($source_data as $k => $v)
{
$key = (empty($source_key) || ($source_key == '*')) ? $k : $v[$source_key];
$value = (empty($source_value) || ($source_value == '*')) ? $v : $v[$source_value];
if ($source_translate)
{
$value = JText::_($value);
}
$options[] = JHtml::_('select.option', $key, $value, 'value', 'text');
}
}
}
}
}
reset($options);
return $options;
}
}
PK t!]�+E�� � header/fieldsql.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Generic field header, with drop down filters based on a SQL query
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderFieldsql extends F0FFormHeaderFieldselectable
{
/**
* Create objects for the options
*
* @return array The array of option objects
*/
protected function getOptions()
{
$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 = F0FPlatform::getInstance()->getDbo();
// Set the query and get the result list.
$db->setQuery($query);
$items = $db->loadObjectlist();
// 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;
}
}
PK t!]���� header/accesslevel.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Access level field header
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderAccesslevel extends F0FFormHeaderFieldselectable
{
/**
* Method to get the list of access levels
*
* @return array A list of access levels.
*
* @since 2.0
*/
protected function getOptions()
{
$db = F0FPlatform::getInstance()->getDbo();
$query = $db->getQuery(true);
$query->select('a.id AS value, a.title AS text');
$query->from('#__viewlevels AS a');
$query->group('a.id, a.title, a.ordering');
$query->order('a.ordering ASC');
$query->order($query->qn('title') . ' ASC');
// Get the options.
$db->setQuery($query);
$options = $db->loadObjectList();
return $options;
}
}
PK t!]��Uz z header/filtersearchable.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Generic filter, text box entry with optional buttons
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderFiltersearchable extends F0FFormHeaderFieldsearchable
{
/**
* Get the header
*
* @return string The header HTML
*/
protected function getHeader()
{
return '';
}
}
PK t!]��]�v v header/filterselectable.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Generic filter, drop-down based on fixed options
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderFilterselectable extends F0FFormHeaderFieldselectable
{
/**
* Get the header
*
* @return string The header HTML
*/
protected function getHeader()
{
return '';
}
}
PK t!]F��o o header/filterdate.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Generic filter, text box entry with calendar button
*
* @package FrameworkOnFramework
* @since 2.3.3
*/
class F0FFormHeaderFilterdate extends F0FFormHeaderFielddate
{
/**
* Get the header
*
* @return string The header HTML
*/
protected function getHeader()
{
return '';
}
}
PK t!]V�ȥd d header/filtersql.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Generic filter, drop-down based on SQL query
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderFiltersql extends F0FFormHeaderFieldsql
{
/**
* Get the header
*
* @return string The header HTML
*/
protected function getHeader()
{
return '';
}
}
PK t!]^ڸb7 7 header/ordering.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Ordering field header
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderOrdering extends F0FFormHeader
{
/**
* Get the header
*
* @return string The header HTML
*/
protected function getHeader()
{
$sortable = ($this->element['sortable'] != 'false');
$view = $this->form->getView();
$model = $this->form->getModel();
$hasAjaxOrderingSupport = $view->hasAjaxOrderingSupport();
if (!$sortable)
{
// Non sortable?! I'm not sure why you'd want that, but if you insist...
return JText::_('JGRID_HEADING_ORDERING');
}
if (!$hasAjaxOrderingSupport)
{
// Ye olde Joomla! 2.5 method
$html = JHTML::_('grid.sort', 'JFIELD_ORDERING_LABEL', 'ordering', $view->getLists()->order_Dir, $view->getLists()->order, 'browse');
$html .= JHTML::_('grid.order', $model->getList());
return $html;
}
else
{
// The new, drag'n'drop ordering support WITH a save order button
$html = JHtml::_(
'grid.sort',
'<i class="icon-menu-2"></i>',
'ordering',
$view->getLists()->order_Dir,
$view->getLists()->order,
null,
'asc',
'JGRID_HEADING_ORDERING'
);
$ordering = $view->getLists()->order == 'ordering';
if ($ordering)
{
$html .= '<a href="javascript:saveorder(' . (count($model->getList()) - 1) . ', \'saveorder\')" ' .
'rel="tooltip" class="save-order btn btn-micro pull-right" title="' . JText::_('JLIB_HTML_SAVE_ORDER') . '">'
. '<span class="icon-ok"></span></a>';
}
return $html;
}
}
}
PK t!]i�*� � header/field.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Generic field header, without any filters
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderField extends F0FFormHeader
{
/**
* Get the header
*
* @return string The header HTML
*/
protected function getHeader()
{
$sortable = ($this->element['sortable'] != 'false');
$label = $this->getLabel();
if ($sortable)
{
$view = $this->form->getView();
return JHTML::_('grid.sort', $label, $this->name,
$view->getLists()->order_Dir, $view->getLists()->order,
$this->form->getModel()->task
);
}
else
{
return JText::_($label);
}
}
}
PK t!]还� � header/fielddate.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Generic field header, with text input (search) filter
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderFielddate extends F0FFormHeaderField
{
/**
* Get the filter field
*
* @return string The HTML
*/
protected function getFilter()
{
// Initialize some field attributes.
$format = $this->element['format'] ? (string) $this->element['format'] : '%Y-%m-%d';
$attributes = array();
if ($this->element['size'])
{
$attributes['size'] = (int) $this->element['size'];
}
if ($this->element['maxlength'])
{
$attributes['maxlength'] = (int) $this->element['maxlength'];
}
if ($this->element['filterclass'])
{
$attributes['class'] = (string) $this->element['filterclass'];
}
if ((string) $this->element['readonly'] == 'true')
{
$attributes['readonly'] = 'readonly';
}
if ((string) $this->element['disabled'] == 'true')
{
$attributes['disabled'] = 'disabled';
}
if ($this->element['onchange'])
{
$attributes['onchange'] = (string) $this->element['onchange'];
}
else
{
$onchange = 'document.adminForm.submit()';
}
if ((string) $this->element['placeholder'])
{
$attributes['placeholder'] = JText::_((string) $this->element['placeholder']);
}
$name = $this->element['searchfieldname'] ? $this->element['searchfieldname'] : $this->name;
if ($this->element['searchfieldname'])
{
$model = $this->form->getModel();
$searchvalue = $model->getState((string) $this->element['searchfieldname']);
}
else
{
$searchvalue = $this->value;
}
// Get some system objects.
$config = F0FPlatform::getInstance()->getConfig();
$user = JFactory::getUser();
// If a known filter is given use it.
switch (strtoupper((string) $this->element['filter']))
{
case 'SERVER_UTC':
// Convert a date to UTC based on the server timezone.
if ((int) $this->value)
{
// Get a date object based on the correct timezone.
$date = F0FPlatform::getInstance()->getDate($searchvalue, 'UTC');
$date->setTimezone(new DateTimeZone($config->get('offset')));
// Transform the date string.
$searchvalue = $date->format('Y-m-d H:i:s', true, false);
}
break;
case 'USER_UTC':
// Convert a date to UTC based on the user timezone.
if ((int) $searchvalue)
{
// Get a date object based on the correct timezone.
$date = F0FPlatform::getInstance()->getDate($this->value, 'UTC');
$date->setTimezone(new DateTimeZone($user->getParam('timezone', $config->get('offset'))));
// Transform the date string.
$searchvalue = $date->format('Y-m-d H:i:s', true, false);
}
break;
}
return JHtml::_('calendar', $searchvalue, $name, $name, $format, $attributes);
}
/**
* Get the buttons HTML code
*
* @return string The HTML
*/
protected function getButtons()
{
return '';
}
}
PK t!]��z z header/filterfilterable.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Generic filter, text box entry with optional buttons
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormHeaderFilterfilterable extends F0FFormHeaderFieldfilterable
{
/**
* Get the header
*
* @return string The header HTML
*/
protected function getHeader()
{
return '';
}
}
PK t!]��L%c? c? form.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
if (version_compare(JVERSION, '2.5.0', 'lt'))
{
jimport('joomla.form.form');
jimport('joomla.form.formfield');
jimport('joomla.form.formrule');
}
/**
* F0FForm is an extension to JForm which support not only edit views but also
* browse (record list) and read (single record display) views based on XML
* forms.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FForm extends JForm
{
/**
* The model attached to this view
*
* @var F0FModel
*/
protected $model;
/**
* The view used to render this form
*
* @var F0FView
*/
protected $view;
/**
* Method to get an instance of a form.
*
* @param string $name The name of the form.
* @param string $data The name of an XML file or string to load as the form definition.
* @param array $options An array of form options.
* @param bool $replace Flag to toggle whether form fields should be replaced if a field
* already exists with the same group/name.
* @param bool|string $xpath An optional xpath to search for the fields.
*
* @return object F0FForm instance.
*
* @since 2.0
* @throws InvalidArgumentException if no data provided.
* @throws RuntimeException if the form could not be loaded.
*/
public static function getInstance($name, $data = null, $options = array(), $replace = true, $xpath = false)
{
// Reference to array with form instances
$forms = &self::$forms;
// Only instantiate the form if it does not already exist.
if (!isset($forms[$name]))
{
$data = trim($data);
if (empty($data))
{
throw new InvalidArgumentException(sprintf('F0FForm::getInstance(name, *%s*)', gettype($data)));
}
// Instantiate the form.
$forms[$name] = new F0FForm($name, $options);
// Load the data.
if (substr(trim($data), 0, 1) == '<')
{
if ($forms[$name]->load($data, $replace, $xpath) == false)
{
throw new RuntimeException('F0FForm::getInstance could not load form');
}
}
else
{
if ($forms[$name]->loadFile($data, $replace, $xpath) == false)
{
throw new RuntimeException('F0FForm::getInstance could not load file ' . $data . '.xml');
}
}
}
return $forms[$name];
}
/**
* Returns the value of an attribute of the form itself
*
* @param string $attribute The name of the attribute
* @param mixed $default Optional default value to return
*
* @return mixed
*
* @since 2.0
*/
public function getAttribute($attribute, $default = null)
{
$value = $this->xml->attributes()->$attribute;
if (is_null($value))
{
return $default;
}
else
{
return (string) $value;
}
}
/**
* Loads the CSS files defined in the form, based on its cssfiles attribute
*
* @return void
*
* @since 2.0
*/
public function loadCSSFiles()
{
// Support for CSS files
$cssfiles = $this->getAttribute('cssfiles');
if (!empty($cssfiles))
{
$cssfiles = explode(',', $cssfiles);
foreach ($cssfiles as $cssfile)
{
F0FTemplateUtils::addCSS(trim($cssfile));
}
}
// Support for LESS files
$lessfiles = $this->getAttribute('lessfiles');
if (!empty($lessfiles))
{
$lessfiles = explode(',', $lessfiles);
foreach ($lessfiles as $def)
{
$parts = explode('||', $def, 2);
$lessfile = $parts[0];
$alt = (count($parts) > 1) ? trim($parts[1]) : null;
F0FTemplateUtils::addLESS(trim($lessfile), $alt);
}
}
}
/**
* Loads the Javascript files defined in the form, based on its jsfiles attribute
*
* @return void
*
* @since 2.0
*/
public function loadJSFiles()
{
$jsfiles = $this->getAttribute('jsfiles');
if (empty($jsfiles))
{
return;
}
$jsfiles = explode(',', $jsfiles);
foreach ($jsfiles as $jsfile)
{
F0FTemplateUtils::addJS(trim($jsfile));
}
}
/**
* Returns a reference to the protected $data object, allowing direct
* access to and manipulation of the form's data.
*
* @return JRegistry The form's data registry
*
* @since 2.0
*/
public function getData()
{
return $this->data;
}
/**
* Attaches a F0FModel to this form
*
* @param F0FModel &$model The model to attach to the form
*
* @return void
*/
public function setModel(F0FModel &$model)
{
$this->model = $model;
}
/**
* Returns the F0FModel attached to this form
*
* @return F0FModel
*/
public function &getModel()
{
return $this->model;
}
/**
* Attaches a F0FView to this form
*
* @param F0FView &$view The view to attach to the form
*
* @return void
*/
public function setView(F0FView &$view)
{
$this->view = $view;
}
/**
* Returns the F0FView attached to this form
*
* @return F0FView
*/
public function &getView()
{
return $this->view;
}
/**
* Method to get an array of F0FFormHeader objects in the headerset.
*
* @return array The array of F0FFormHeader objects in the headerset.
*
* @since 2.0
*/
public function getHeaderset()
{
$fields = array();
$elements = $this->findHeadersByGroup();
// If no field elements were found return empty.
if (empty($elements))
{
return $fields;
}
// Build the result array from the found field elements.
foreach ($elements as $element)
{
// Get the field groups for the element.
$attrs = $element->xpath('ancestor::headers[@name]/@name');
$groups = array_map('strval', $attrs ? $attrs : array());
$group = implode('.', $groups);
// If the field is successfully loaded add it to the result array.
if ($field = $this->loadHeader($element, $group))
{
$fields[$field->id] = $field;
}
}
return $fields;
}
/**
* Method to get an array of <header /> elements from the form XML document which are
* in a control group by name.
*
* @param mixed $group The optional dot-separated form group path on which to find the fields.
* Null will return all fields. False will return fields not in a group.
* @param boolean $nested True to also include fields in nested groups that are inside of the
* group for which to find fields.
*
* @return mixed Boolean false on error or array of SimpleXMLElement objects.
*
* @since 2.0
*/
protected function &findHeadersByGroup($group = null, $nested = false)
{
$false = false;
$fields = array();
// Make sure there is a valid JForm XML document.
if (!($this->xml instanceof SimpleXMLElement))
{
return $false;
}
// Get only fields in a specific group?
if ($group)
{
// Get the fields elements for a given group.
$elements = &$this->findHeader($group);
// Get all of the field elements for the fields elements.
foreach ($elements as $element)
{
// If there are field elements add them to the return result.
if ($tmp = $element->xpath('descendant::header'))
{
// If we also want fields in nested groups then just merge the arrays.
if ($nested)
{
$fields = array_merge($fields, $tmp);
}
// If we want to exclude nested groups then we need to check each field.
else
{
$groupNames = explode('.', $group);
foreach ($tmp as $field)
{
// Get the names of the groups that the field is in.
$attrs = $field->xpath('ancestor::headers[@name]/@name');
$names = array_map('strval', $attrs ? $attrs : array());
// If the field is in the specific group then add it to the return list.
if ($names == (array) $groupNames)
{
$fields = array_merge($fields, array($field));
}
}
}
}
}
}
elseif ($group === false)
{
// Get only field elements not in a group.
$fields = $this->xml->xpath('descendant::headers[not(@name)]/header | descendant::headers[not(@name)]/headerset/header ');
}
else
{
// Get an array of all the <header /> elements.
$fields = $this->xml->xpath('//header');
}
return $fields;
}
/**
* Method to get a header field represented as a F0FFormHeader object.
*
* @param string $name The name of the header 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 F0FFormHeader object for the field or boolean false on error.
*
* @since 2.0
*/
public function getHeader($name, $group = null, $value = null)
{
// Make sure there is a valid F0FForm XML document.
if (!($this->xml instanceof SimpleXMLElement))
{
return false;
}
// Attempt to find the field by name and group.
$element = $this->findHeader($name, $group);
// If the field element was not found return false.
if (!$element)
{
return false;
}
return $this->loadHeader($element, $group, $value);
}
/**
* Method to get a header field represented as an XML element object.
*
* @param string $name The name of the form field.
* @param string $group The optional dot-separated form group path on which to find the field.
*
* @return mixed The XML element object for the field or boolean false on error.
*
* @since 2.0
*/
protected function findHeader($name, $group = null)
{
$element = false;
$fields = array();
// Make sure there is a valid JForm XML document.
if (!($this->xml instanceof SimpleXMLElement))
{
return false;
}
// Let's get the appropriate field element based on the method arguments.
if ($group)
{
// Get the fields elements for a given group.
$elements = &$this->findGroup($group);
// Get all of the field elements with the correct name for the fields elements.
foreach ($elements as $element)
{
// If there are matching field elements add them to the fields array.
if ($tmp = $element->xpath('descendant::header[@name="' . $name . '"]'))
{
$fields = array_merge($fields, $tmp);
}
}
// Make sure something was found.
if (!$fields)
{
return false;
}
// Use the first correct match in the given group.
$groupNames = explode('.', $group);
foreach ($fields as &$field)
{
// Get the group names as strings for ancestor fields elements.
$attrs = $field->xpath('ancestor::headerfields[@name]/@name');
$names = array_map('strval', $attrs ? $attrs : array());
// If the field is in the exact group use it and break out of the loop.
if ($names == (array) $groupNames)
{
$element = &$field;
break;
}
}
}
else
{
// Get an array of fields with the correct name.
$fields = $this->xml->xpath('//header[@name="' . $name . '"]');
// Make sure something was found.
if (!$fields)
{
return false;
}
// Search through the fields for the right one.
foreach ($fields as &$field)
{
// If we find an ancestor fields element with a group name then it isn't what we want.
if ($field->xpath('ancestor::headerfields[@name]'))
{
continue;
}
// Found it!
else
{
$element = &$field;
break;
}
}
}
return $element;
}
/**
* Method to load, setup and return a F0FFormHeader 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 F0FFormHeader object for the field or boolean false on error.
*
* @since 2.0
*/
protected function loadHeader($element, $group = null, $value = null)
{
// Make sure there is a valid SimpleXMLElement.
if (!($element instanceof SimpleXMLElement))
{
return false;
}
// Get the field type.
$type = $element['type'] ? (string) $element['type'] : 'field';
// Load the JFormField object for the field.
$field = $this->loadHeaderType($type);
// If the object could not be loaded, get a text field object.
if ($field === false)
{
$field = $this->loadHeaderType('field');
}
// Setup the F0FFormHeader object.
$field->setForm($this);
if ($field->setup($element, $value, $group))
{
return $field;
}
else
{
return false;
}
}
/**
* Method to remove a header from the form definition.
*
* @param string $name The name of the form field for which remove.
* @param string $group The optional dot-separated form group path on which to find the field.
*
* @return boolean True on success, false otherwise.
*
* @throws UnexpectedValueException
*/
public function removeHeader($name, $group = null)
{
// Make sure there is a valid JForm XML document.
if (!($this->xml instanceof SimpleXMLElement))
{
throw new UnexpectedValueException(sprintf('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this)));
}
// Find the form field element from the definition.
$element = $this->findHeader($name, $group);
// If the element exists remove it from the form definition.
if ($element instanceof SimpleXMLElement)
{
$dom = dom_import_simplexml($element);
$dom->parentNode->removeChild($dom);
return true;
}
return false;
}
/**
* Proxy for {@link F0FFormHelper::loadFieldType()}.
*
* @param string $type The field type.
* @param boolean $new Flag to toggle whether we should get a new instance of the object.
*
* @return mixed F0FFormField object on success, false otherwise.
*
* @since 2.0
*/
protected function loadFieldType($type, $new = true)
{
return F0FFormHelper::loadFieldType($type, $new);
}
/**
* Proxy for {@link F0FFormHelper::loadHeaderType()}.
*
* @param string $type The field type.
* @param boolean $new Flag to toggle whether we should get a new instance of the object.
*
* @return mixed F0FFormHeader object on success, false otherwise.
*
* @since 2.0
*/
protected function loadHeaderType($type, $new = true)
{
return F0FFormHelper::loadHeaderType($type, $new);
}
/**
* Proxy for {@link F0FFormHelper::loadRuleType()}.
*
* @param string $type The rule type.
* @param boolean $new Flag to toggle whether we should get a new instance of the object.
*
* @return mixed JFormRule object on success, false otherwise.
*
* @see F0FFormHelper::loadRuleType()
* @since 2.0
*/
protected function loadRuleType($type, $new = true)
{
return F0FFormHelper::loadRuleType($type, $new);
}
/**
* Proxy for {@link F0FFormHelper::addFieldPath()}.
*
* @param mixed $new A path or array of paths to add.
*
* @return array The list of paths that have been added.
*
* @since 2.0
*/
public static function addFieldPath($new = null)
{
return F0FFormHelper::addFieldPath($new);
}
/**
* Proxy for {@link F0FFormHelper::addHeaderPath()}.
*
* @param mixed $new A path or array of paths to add.
*
* @return array The list of paths that have been added.
*
* @since 2.0
*/
public static function addHeaderPath($new = null)
{
return F0FFormHelper::addHeaderPath($new);
}
/**
* Proxy for F0FFormHelper::addFormPath().
*
* @param mixed $new A path or array of paths to add.
*
* @return array The list of paths that have been added.
*
* @see F0FFormHelper::addFormPath()
* @since 2.0
*/
public static function addFormPath($new = null)
{
return F0FFormHelper::addFormPath($new);
}
/**
* Proxy for F0FFormHelper::addRulePath().
*
* @param mixed $new A path or array of paths to add.
*
* @return array The list of paths that have been added.
*
* @see F0FFormHelper::addRulePath()
* @since 2.0
*/
public static function addRulePath($new = null)
{
return F0FFormHelper::addRulePath($new);
}
}
PK t!]�y�ƨ
�
field/email.phpnu &1i� <?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to. <fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var array $spellcheck Options available for this field.
* @var string $accept File types that are accepted.
*/
$autocomplete = !$autocomplete ? 'autocomplete="off"' : 'autocomplete="' . $autocomplete . '"';
$autocomplete = $autocomplete == 'autocomplete="on"' ? '' : $autocomplete;
$attributes = array(
$spellcheck ? '' : 'spellcheck="false"',
!empty($size) ? 'size="' . $size . '"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
$onchange ? 'onchange="' . $onchange . '"' : '',
$autocomplete,
$multiple ? 'multiple' : '',
!empty($maxLength) ? 'maxlength="' . $maxLength . '"' : '',
strlen($hint) ? 'placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '',
$required ? 'required aria-required="true"' : '',
$autofocus ? 'autofocus' : '',
);
// Including fallback code for HTML5 non supported browsers.
JHtml::_('jquery.framework');
JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9'));
?>
<input type="email" name="<?php
echo $name; ?>"<?php
echo !empty($class) ? ' class="validate-email ' . $class . '"' : ' class="validate-email"'; ?> id="<?php
echo $id; ?>" value="<?php
echo htmlspecialchars(JStringPunycode::emailToUTF8($value), ENT_COMPAT, 'UTF-8'); ?>"
<?php echo implode(' ', $attributes); ?> />
PK t!]��AI� � field/cachehandler.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
JFormHelper::loadFieldClass('cachehandler');
/**
* Form Field class for F0F
* Joomla! cache handlers
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldCachehandler extends JFormFieldCacheHandler implements F0FFormField
{
protected $static;
protected $repeatable;
/** @var F0FTable 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.
*
* @since 2.0
*/
public function __get($name)
{
switch ($name)
{
case 'static':
if (empty($this->static))
{
$this->static = $this->getStatic();
}
return $this->static;
break;
case 'repeatable':
if (empty($this->repeatable))
{
$this->repeatable = $this->getRepeatable();
}
return $this->repeatable;
break;
default:
return parent::__get($name);
}
}
/**
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
*
* @since 2.0
*
* @return string The field HTML
*/
public function getStatic()
{
$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
return '<span id="' . $this->id . '" ' . $class . '>' .
htmlspecialchars(F0FFormFieldList::getOptionName($this->getOptions(), $this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
/**
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
*
* @since 2.0
*
* @return string The field HTML
*/
public function getRepeatable()
{
$class = $this->element['class'] ? (string) $this->element['class'] : '';
return '<span class="' . $this->id . ' ' . $class . '">' .
htmlspecialchars(F0FFormFieldList::getOptionName($this->getOptions(), $this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK t!]�hq* * field/groupedlist.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
JFormHelper::loadFieldClass('groupedlist');
/**
* Form Field class for F0F
* Supports a generic list of options.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldGroupedlist extends JFormFieldGroupedList implements F0FFormField
{
protected $static;
protected $repeatable;
/** @var F0FTable 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.
*
* @since 2.0
*/
public function __get($name)
{
switch ($name)
{
case 'static':
if (empty($this->static))
{
$this->static = $this->getStatic();
}
return $this->static;
break;
case 'repeatable':
if (empty($this->repeatable))
{
$this->repeatable = $this->getRepeatable();
}
return $this->repeatable;
break;
default:
return parent::__get($name);
}
}
/**
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
*
* @since 2.0
*
* @return string The field HTML
*/
public function getStatic()
{
$class = $this->element['class'] ? (string) $this->element['class'] : '';
$selected = self::getOptionName($this->getGroups(), $this->value);
if (is_null($selected))
{
$selected = array(
'group' => '',
'item' => ''
);
}
return '<span id="' . $this->id . '-group" class="fof-groupedlist-group ' . $class . '>' .
htmlspecialchars($selected['group'], ENT_COMPAT, 'UTF-8') .
'</span>' .
'<span id="' . $this->id . '-item" class="fof-groupedlist-item ' . $class . '>' .
htmlspecialchars($selected['item'], ENT_COMPAT, 'UTF-8') .
'</span>';
}
/**
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
*
* @since 2.0
*
* @return string The field HTML
*/
public function getRepeatable()
{
$class = $this->element['class'] ? (string) $this->element['class'] : '';
$selected = self::getOptionName($this->getGroups(), $this->value);
if (is_null($selected))
{
$selected = array(
'group' => '',
'item' => ''
);
}
return '<span class="' . $this->id . '-group fof-groupedlist-group ' . $class . '">' .
htmlspecialchars($selected['group'], ENT_COMPAT, 'UTF-8') .
'</span>' .
'<span class="' . $this->id . '-item fof-groupedlist-item ' . $class . '">' .
htmlspecialchars($selected['item'], ENT_COMPAT, 'UTF-8') .
'</span>';
}
/**
* Gets the active option's label given an array of JHtml options
*
* @param array $data The JHtml options to parse
* @param mixed $selected The currently selected value
* @param string $groupKey Group name
* @param string $optKey Key name
* @param string $optText Value name
*
* @return mixed The label of the currently selected option
*/
public static function getOptionName($data, $selected = null, $groupKey = 'items', $optKey = 'value', $optText = 'text')
{
$ret = null;
foreach ($data as $dataKey => $group)
{
$label = $dataKey;
$noGroup = is_int($dataKey);
if (is_array($group))
{
$subList = $group[$groupKey];
$label = $group[$optText];
$noGroup = false;
}
elseif (is_object($group))
{
// Sub-list is in a property of an object
$subList = $group->$groupKey;
$label = $group->$optText;
$noGroup = false;
}
else
{
throw new RuntimeException('Invalid group contents.', 1);
}
if ($noGroup)
{
$label = '';
}
$match = F0FFormFieldList::getOptionName($data, $selected, $optKey, $optText);
if (!is_null($match))
{
$ret = array(
'group' => $label,
'item' => $match
);
break;
}
}
return $ret;
}
}
PK t!]擁L field/editor.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
JFormHelper::loadFieldClass('editor');
/**
* Form Field class for the F0F framework
* An editarea field for content creation and formatted HTML display
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldEditor extends JFormFieldEditor implements F0FFormField
{
protected $static;
protected $repeatable;
/** @var F0FTable 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.
*
* @since 2.0
*/
public function __get($name)
{
switch ($name)
{
case 'static':
if (empty($this->static))
{
$this->static = $this->getStatic();
}
return $this->static;
break;
case 'repeatable':
if (empty($this->repeatable))
{
$this->repeatable = $this->getRepeatable();
}
return $this->repeatable;
break;
default:
return parent::__get($name);
}
}
/**
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
*
* @since 2.0
*
* @return string The field HTML
*/
public function getStatic()
{
$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
return '<div id="' . $this->id . '" ' . $class . '>' . $this->value . '</div>';
}
/**
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
*
* @since 2.0
*
* @return string The field HTML
*/
public function getRepeatable()
{
$class = $this->element['class'] ? (string) $this->element['class'] : '';
return '<div class="' . $this->id . ' ' . $class . '">' . $this->value . '</div>';
}
}
PK t!]��ν� � field/sessionhandler.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
JFormHelper::loadFieldClass('sessionhandler');
/**
* Form Field class for F0F
* Joomla! session handlers
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldSessionhandler extends JFormFieldSessionHandler implements F0FFormField
{
protected $static;
protected $repeatable;
/** @var F0FTable 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.
*
* @since 2.0
*/
public function __get($name)
{
switch ($name)
{
case 'static':
if (empty($this->static))
{
$this->static = $this->getStatic();
}
return $this->static;
break;
case 'repeatable':
if (empty($this->repeatable))
{
$this->repeatable = $this->getRepeatable();
}
return $this->repeatable;
break;
default:
return parent::__get($name);
}
}
/**
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
*
* @since 2.0
*
* @return string The field HTML
*/
public function getStatic()
{
$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
return '<span id="' . $this->id . '" ' . $class . '>' .
htmlspecialchars(F0FFormFieldList::getOptionName($this->getOptions(), $this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
/**
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
*
* @since 2.0
*
* @return string The field HTML
*/
public function getRepeatable()
{
$class = $this->element['class'] ? (string) $this->element['class'] : '';
return '<span class="' . $this->id . ' ' . $class . '">' .
htmlspecialchars(F0FFormFieldList::getOptionName($this->getOptions(), $this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK t!]�X�B� � field/password.phpnu &1i� <?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to. <fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var boolean $lock Is this field locked.
*/
if ($meter)
{
JHtml::_('script', 'system/passwordstrength.js', array('version' => 'auto', 'relative' => true, 'framework' => true));
// Load script on document load.
JFactory::getDocument()->addScriptDeclaration(
"
jQuery(document).ready(function() {
new Form.PasswordStrength('" . $id . "',
{
threshold: " . $threshold . ",
onUpdate: function(element, strength, threshold) {
element.set('data-passwordstrength', strength);
}
});
});"
);
}
// Including fallback code for HTML5 non supported browsers.
JHtml::_('jquery.framework');
JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9'));
if ($lock)
{
// Load script on document load.
JFactory::getDocument()->addScriptDeclaration(
"
jQuery(document).ready(function() {
jQuery('#" . $id ."_lock').on('click', function() {
var lockButton = jQuery(this);
var passwordInput = jQuery('#" . $id . "');
var lock = lockButton.hasClass('active');
if (lock === true) {
lockButton.html('" . JText::_('JMODIFY', true) . "');
passwordInput.attr('disabled', true);
passwordInput.val('');
}
else
{
lockButton.html('" . JText::_('JCANCEL', true) . "');
passwordInput.attr('disabled', false);
}
});
});"
);
$disabled = true;
$hint = str_repeat('*', strlen($value));
$value = '';
}
$attributes = array(
strlen($hint) ? 'placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '',
!$autocomplete ? 'autocomplete="off"' : '',
!empty($class) ? 'class="' . $class . '"' : '',
$readonly ? 'readonly' : '',
$disabled ? 'disabled' : '',
!empty($size) ? 'size="' . $size . '"' : '',
!empty($maxLength) ? 'maxlength="' . $maxLength . '"' : '',
$required ? 'required aria-required="true"' : '',
$autofocus ? 'autofocus' : '',
);
?>
<?php if ($lock): ?>
<span class="input-append">
<?php endif; ?>
<input
type="password"
name="<?php echo $name; ?>"
id="<?php echo $id; ?>"
value="<?php echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>"
<?php echo implode(' ', $attributes); ?>
/>
<?php if ($lock): ?>
<button type="button" id="<?php echo $id; ?>_lock" class="btn btn-info" data-toggle="button"><?php echo JText::_('JMODIFY'); ?></button>
</span>
<?php endif; ?>
PK t!]Q=Т� � field/plugins.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
JFormHelper::loadFieldClass('plugins');
/**
* Form Field class for F0F
* Plugins installed on the site
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldPlugins extends JFormFieldPlugins implements F0FFormField
{
protected $static;
protected $repeatable;
/** @var F0FTable 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.
*
* @since 2.0
*/
public function __get($name)
{
switch ($name)
{
case 'static':
if (empty($this->static))
{
$this->static = $this->getStatic();
}
return $this->static;
break;
case 'repeatable':
if (empty($this->repeatable))
{
$this->repeatable = $this->getRepeatable();
}
return $this->repeatable;
break;
default:
return parent::__get($name);
}
}
/**
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
*
* @since 2.0
*
* @return string The field HTML
*/
public function getStatic()
{
$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
return '<span id="' . $this->id . '" ' . $class . '>' .
htmlspecialchars(F0FFormFieldList::getOptionName($this->getOptions(), $this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
/**
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
*
* @since 2.0
*
* @return string The field HTML
*/
public function getRepeatable()
{
$class = $this->element['class'] ? (string) $this->element['class'] : '';
return '<span class="' . $this->id . ' ' . $class . '">' .
htmlspecialchars(F0FFormFieldList::getOptionName($this->getOptions(), $this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK t!]e��nt t field/relation.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
/**
* Form Field class for F0F
* Relation list
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldRelation extends F0FFormFieldList
{
/**
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
*
* @since 2.0
*
* @return string The field HTML
*/
public function getStatic() {
return $this->getRepeatable();
}
/**
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
*
* @since 2.0
*
* @return string The field HTML
*/
public function getRepeatable()
{
$class = $this->element['class'] ? (string) $this->element['class'] : $this->id;
$relationclass = $this->element['relationclass'] ? (string) $this->element['relationclass'] : '';
$value_field = $this->element['value_field'] ? (string) $this->element['value_field'] : 'title';
$translate = $this->element['translate'] ? (string) $this->element['translate'] : false;
$link_url = $this->element['url'] ? (string) $this->element['url'] : false;
if (!($link_url && $this->item instanceof F0FTable))
{
$link_url = false;
}
if ($this->element['empty_replacement'])
{
$empty_replacement = (string) $this->element['empty_replacement'];
}
$relationName = F0FInflector::pluralize($this->name);
$relations = $this->item->getRelations()->getMultiple($relationName);
foreach ($relations as $relation) {
$html = '<span class="' . $relationclass . '">';
if ($link_url)
{
$keyfield = $relation->getKeyName();
$this->_relationId = $relation->$keyfield;
$url = $this->parseFieldTags($link_url);
$html .= '<a href="' . $url . '">';
}
$value = $relation->get($relation->getColumnAlias($value_field));
// Get the (optionally formatted) value
if (!empty($empty_replacement) && empty($value))
{
$value = JText::_($empty_replacement);
}
if ($translate == true)
{
$html .= JText::_($value);
}
else
{
$html .= $value;
}
if ($link_url)
{
$html .= '</a>';
}
$html .= '</span>';
$rels[] = $html;
}
$html = '<span class="' . $class . '">';
$html .= implode(', ', $rels);
$html .= '</span>';
return $html;
}
/**
* Method to get the field options.
*
* @return array The field option objects.
*/
protected function getOptions()
{
$options = array();
$this->value = array();
$value_field = $this->element['value_field'] ? (string) $this->element['value_field'] : 'title';
$input = new F0FInput;
$component = ucfirst(str_replace('com_', '', $input->getString('option')));
$view = ucfirst($input->getString('view'));
$relation = F0FInflector::pluralize((string) $this->element['name']);
$model = F0FModel::getTmpInstance(ucfirst($relation), $component . 'Model');
$table = $model->getTable();
$key = $table->getKeyName();
$value = $table->getColumnAlias($value_field);
foreach ($model->getItemList(true) as $option)
{
$options[] = JHtml::_('select.option', $option->$key, $option->$value);
}
if ($id = F0FModel::getAnInstance($view)->getId())
{
$table = F0FTable::getInstance($view, $component . 'Table');
$table->load($id);
$relations = $table->getRelations()->getMultiple($relation);
foreach ($relations as $item)
{
$this->value[] = $item->getId();
}
}
return $options;
}
/**
* Replace string with tags that reference fields
*
* @param string $text Text to process
*
* @return string Text with tags replace
*/
protected function parseFieldTags($text)
{
$ret = $text;
// Replace [ITEM:ID] in the URL with the item's key value (usually:
// the auto-incrementing numeric ID)
$keyfield = $this->item->getKeyName();
$replace = $this->item->$keyfield;
$ret = str_replace('[ITEM:ID]', $replace, $ret);
// Replace the [ITEMID] in the URL with the current Itemid parameter
$ret = str_replace('[ITEMID]', JFactory::getApplication()->input->getInt('Itemid', 0), $ret);
// Replace the [RELATION:ID] in the URL with the relation's key value
$ret = str_replace('[RELATION:ID]', $this->_relationId, $ret);
// Replace other field variables in the URL
$fields = $this->item->getTableFields();
foreach ($fields as $fielddata)
{
$fieldname = $fielddata->Field;
if (empty($fieldname))
{
$fieldname = $fielddata->column_name;
}
$search = '[ITEM:' . strtoupper($fieldname) . ']';
$replace = $this->item->$fieldname;
$ret = str_replace($search, $replace, $ret);
}
return $ret;
}
}
PK t!]wjȬ � field/user.phpnu &1i� <?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to. <fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
*
* @var string $userName The user name
* @var mixed $groups The filtering groups (null means no filtering)
* @var mixed $excluded The users to exclude from the list of users
*/
if (!$readonly)
{
JHtml::_('behavior.modal', 'a.modal_' . $id);
JHtml::_('script', 'jui/fielduser.min.js', array('version' => 'auto', 'relative' => true));
}
$uri = new JUri('index.php?option=com_users&view=users&layout=modal&tmpl=component&required=0');
$uri->setVar('field', $this->escape($id));
if ($required)
{
$uri->setVar('required', 1);
}
if (!empty($groups))
{
$uri->setVar('groups', base64_encode(json_encode($groups)));
}
if (!empty($excluded))
{
$uri->setVar('excluded', base64_encode(json_encode($excluded)));
}
// Invalidate the input value if no user selected
if ($this->escape($userName) === JText::_('JLIB_FORM_SELECT_USER'))
{
$userName = '';
}
$inputAttributes = array(
'type' => 'text', 'id' => $id, 'value' => $this->escape($userName)
);
if ($size)
{
$inputAttributes['size'] = (int) $size;
}
if ($required)
{
$inputAttributes['required'] = 'required';
}
if (!$readonly)
{
$inputAttributes['placeholder'] = JText::_('JLIB_FORM_SELECT_USER');
}
$anchorAttributes = array(
'class' => 'btn btn-primary modal_' . $id, 'title' => JText::_('JLIB_FORM_CHANGE_USER'), 'rel' => '{handler: \'iframe\', size: {x: 800, y: 500}}'
);
?>
<div class="input-append">
<input <?php echo ArrayHelper::toString($inputAttributes); ?> readonly />
<?php if (!$readonly) : ?>
<?php echo JHtml::_('link', (string) $uri, '<span class="icon-user"></span>', $anchorAttributes); ?>
<?php endif; ?>
</div>
<?php if (!$readonly) : ?>
<input type="hidden" id="<?php echo $id; ?>_id" name="<?php echo $name; ?>" value="<?php echo (int) $value; ?>" data-onchange="<?php echo $this->escape($onchange); ?>" />
<?php endif; ?>PK t!] �x�� � field/spacer.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
JFormHelper::loadFieldClass('spacer');
/**
* Form Field class for the F0F framework
* Spacer used between form elements
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldSpacer extends JFormFieldSpacer implements F0FFormField
{
protected $static;
protected $repeatable;
/** @var F0FTable 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.
*
* @since 2.0
*/
public function __get($name)
{
switch ($name)
{
case 'static':
if (empty($this->static))
{
$this->static = $this->getStatic();
}
return $this->static;
break;
case 'repeatable':
if (empty($this->repeatable))
{
$this->repeatable = $this->getRepeatable();
}
return $this->repeatable;
break;
default:
return parent::__get($name);
}
}
/**
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
*
* @since 2.0
*
* @return string The field HTML
*/
public function getStatic()
{
return $this->getInput();
}
/**
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
*
* @since 2.0
*
* @return string The field HTML
*/
public function getRepeatable()
{
return $this->getInput();
}
}
PK t!]
��PA
A
field/tel.phpnu &1i� <?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to. <fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var integer $maxLength The maximum length that the field shall accept.
*/
// Including fallback code for HTML5 non supported browsers.
JHtml::_('jquery.framework');
JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9'));
$autocomplete = !$autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $autocomplete . '"';
$autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete;
$attributes = array(
!empty($size) ? 'size="' . $size . '"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
strlen($hint) ? 'placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '',
$autocomplete,
$autofocus ? ' autofocus' : '',
$spellcheck ? '' : 'spellcheck="false"',
$onchange ? ' onchange="' . $onchange . '"' : '',
!empty($maxLength) ? $maxLength : '',
$required ? 'required aria-required="true"' : '',
);
?>
<input type="tel" name="<?php
echo $name; ?>" <?php
echo !empty($class) ? ' class="' . $class . '"' : ''; ?> id="<?php
echo $id; ?>" value="<?php
echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>" <?php echo implode(' ', $attributes); ?> />
PK t!]�3Z}< < field/language.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
JFormHelper::loadFieldClass('language');
/**
* Form Field class for F0F
* Available site languages
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldLanguage extends JFormFieldLanguage implements F0FFormField
{
protected $static;
protected $repeatable;
/** @var F0FTable 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.
*
* @since 2.0
*/
public function __get($name)
{
switch ($name)
{
case 'static':
if (empty($this->static))
{
$this->static = $this->getStatic();
}
return $this->static;
break;
case 'repeatable':
if (empty($this->repeatable))
{
$this->repeatable = $this->getRepeatable();
}
return $this->repeatable;
break;
default:
return parent::__get($name);
}
}
/**
* Method to get the field options.
*
* @since 2.0
*
* @return array The field option objects.
*/
protected function getOptions()
{
$options = parent::getOptions();
$noneoption = $this->element['none'] ? $this->element['none'] : null;
if ($noneoption)
{
array_unshift($options, JHtml::_('select.option', '*', JText::_($noneoption)));
}
return $options;
}
/**
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
*
* @since 2.0
*
* @return string The field HTML
*/
public function getStatic()
{
$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
return '<span id="' . $this->id . '" ' . $class . '>' .
htmlspecialchars(F0FFormFieldList::getOptionName($this->getOptions(), $this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
/**
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
*
* @since 2.0
*
* @return string The field HTML
*/
public function getRepeatable()
{
$class = $this->element['class'] ? (string) $this->element['class'] : '';
return '<span class="' . $this->id . ' ' . $class . '">' .
htmlspecialchars(F0FFormFieldList::getOptionName($this->getOptions(), $this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK t!]Ӵd� � field/radio.phpnu &1i� <?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to. <fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $options Options available for this field.
*/
// Including fallback code for HTML5 non supported browsers.
JHtml::_('jquery.framework');
JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9'));
/**
* The format of the input tag to be filled in using sprintf.
* %1 - id
* %2 - name
* %3 - value
* %4 = any other attributes
*/
$format = '<input type="radio" id="%1$s" name="%2$s" value="%3$s" %4$s />';
$alt = preg_replace('/[^a-zA-Z0-9_\-]/', '_', $name);
?>
<fieldset id="<?php echo $id; ?>" class="<?php echo trim($class . ' radio' . ($readonly || $disabled ? ' disabled' : '') . ($readonly ? ' readonly' : '')); ?>"
<?php echo $disabled ? 'disabled' : ''; ?>
<?php echo $readonly || $disabled ? 'style="pointer-events: none"' : '' ?>
<?php echo $required ? 'required aria-required="true"' : ''; ?>
<?php echo $autofocus ? 'autofocus' : ''; ?>>
<?php if (!empty($options)) : ?>
<?php foreach ($options as $i => $option) : ?>
<?php
// Initialize some option attributes.
$checked = ((string) $option->value === $value) ? 'checked="checked"' : '';
$disabled = !empty($option->disable) ? 'disabled' : '';
$style = $disabled ? 'style="pointer-events: none"' : '';
$option->class = !empty($option->class) ? $option->class : '';
$option->class = trim($option->class . ' ' . $disabled);
$optionClass = !empty($option->class) ? 'class="' . $option->class . '"' : '';
// Initialize some JavaScript option attributes.
$onclick = !empty($option->onclick) ? 'onclick="' . $option->onclick . '"' : '';
$onchange = !empty($option->onchange) ? 'onchange="' . $option->onchange . '"' : '';
$oid = $id . $i;
$ovalue = htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8');
$attributes = array_filter(array($checked, $optionClass, $disabled, $style, $onchange, $onclick));
?>
<?php if ($required) : ?>
<?php $attributes[] = 'required aria-required="true"'; ?>
<?php endif; ?>
<?php echo sprintf($format, $oid, $name, $ovalue, implode(' ', $attributes)); ?>
<label for="<?php echo $oid; ?>" <?php echo trim($optionClass . ' ' . $style); ?>>
<?php echo $option->text; ?>
</label>
<?php endforeach; ?>
<?php endif; ?>
</fieldset>
PK t!]Kn� � field/captcha.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
JFormHelper::loadFieldClass('captcha');
/**
* Form Field class for the F0F framework
* Supports a captcha field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldCaptcha extends JFormFieldCaptcha implements F0FFormField
{
protected $static;
protected $repeatable;
/** @var F0FTable 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.
*
* @since 2.0
*/
public function __get($name)
{
switch ($name)
{
case 'static':
if (empty($this->static))
{
$this->static = $this->getStatic();
}
return $this->static;
break;
case 'repeatable':
if (empty($this->repeatable))
{
$this->repeatable = $this->getRepeatable();
}
return $this->repeatable;
break;
default:
return parent::__get($name);
}
}
/**
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
*
* @since 2.0
*
* @return string The field HTML
*/
public function getStatic()
{
return $this->getInput();
}
/**
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
*
* @since 2.0
*
* @return string The field HTML
*/
public function getRepeatable()
{
return $this->getInput();
}
}
PK t!]Uw��
field/timezone.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
JFormHelper::loadFieldClass('timezone');
/**
* Form Field class for F0F
* Supports a generic list of options.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldTimezone extends JFormFieldTimezone implements F0FFormField
{
protected $static;
protected $repeatable;
/** @var F0FTable 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.
*
* @since 2.0
*/
public function __get($name)
{
switch ($name)
{
case 'static':
if (empty($this->static))
{
$this->static = $this->getStatic();
}
return $this->static;
break;
case 'repeatable':
if (empty($this->repeatable))
{
$this->repeatable = $this->getRepeatable();
}
return $this->repeatable;
break;
default:
return parent::__get($name);
}
}
/**
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
*
* @since 2.0
*
* @return string The field HTML
*/
public function getStatic()
{
$class = $this->element['class'] ? (string) $this->element['class'] : '';
$selected = F0FFormFieldGroupedlist::getOptionName($this->getOptions(), $this->value);
if (is_null($selected))
{
$selected = array(
'group' => '',
'item' => ''
);
}
return '<span id="' . $this->id . '-group" class="fof-groupedlist-group ' . $class . '>' .
htmlspecialchars($selected['group'], ENT_COMPAT, 'UTF-8') .
'</span>' .
'<span id="' . $this->id . '-item" class="fof-groupedlist-item ' . $class . '>' .
htmlspecialchars($selected['item'], ENT_COMPAT, 'UTF-8') .
'</span>';
}
/**
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
*
* @since 2.0
*
* @return string The field HTML
*/
public function getRepeatable()
{
return $this->getStatic();
}
}
PK t!]s��� � field/checkboxes.phpnu &1i� <?php
/**
* @package JCE
* @subpackage Admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to. <fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
*/
/**
* The format of the input tag to be filled in using sprintf.
* %1 - id
* %2 - name
* %3 - value
* %4 = any other attributes
*/
$format = '<input type="checkbox" id="%1$s" name="%2$s" value="%3$s" %4$s />';
// The alt option for Text::alt
$alt = preg_replace('/[^a-zA-Z0-9_\-]/', '_', $name);
?>
<fieldset id="<?php echo $id; ?>" class="<?php echo trim($class . ' checkboxes list-group'); ?>"
<?php echo $required ? 'required aria-required="true"' : ''; ?>
<?php echo $autofocus ? 'autofocus' : ''; ?>>
<?php foreach ($options as $i => $option): ?>
<?php
// Initialize some option attributes.
$checked = in_array((string) $option->value, $checkedOptions, true) ? 'checked' : '';
// In case there is no stored value, use the option's default state.
$checked = (!$hasValue && $option->checked) ? 'checked' : $checked;
$optionClass = !empty($option->class) ? 'class="form-check-input ' . $option->class . '"' : ' class="form-check-input"';
$optionDisabled = !empty($option->disable) || $disabled ? 'disabled' : '';
// Initialize some JavaScript option attributes.
$onclick = !empty($option->onclick) ? 'onclick="' . $option->onclick . '"' : '';
$onchange = !empty($option->onchange) ? 'onchange="' . $option->onchange . '"' : '';
$oid = $id . $i;
$value = htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8');
$attributes = array_filter(array($checked, $optionClass, $optionDisabled, $onchange, $onclick));
?>
<div class="form-check form-check-inline">
<?php echo sprintf($format, $oid, $name, $value, implode(' ', $attributes)); ?>
<label for="<?php echo $oid; ?>" class="checkbox form-check-label">
<?php echo $option->text; ?>
</label>
</div>
<?php endforeach;?>
<input type="hidden" name="<?php echo $name; ?>" value="" />
</fieldset>PK t!]6˟� � field/published.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
JFormHelper::loadFieldClass('list');
/**
* Form Field class for F0F
* Supports a generic list of options.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldPublished extends JFormFieldList implements F0FFormField
{
protected $static;
protected $repeatable;
/** @var F0FTable 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.
*
* @since 2.0
*/
public function __get($name)
{
switch ($name)
{
case 'static':
if (empty($this->static))
{
$this->static = $this->getStatic();
}
return $this->static;
break;
case 'repeatable':
if (empty($this->repeatable))
{
$this->repeatable = $this->getRepeatable();
}
return $this->repeatable;
break;
default:
return parent::__get($name);
}
}
/**
* 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,
);
$configMap = array(
'show_published' => array('published', 1),
'show_unpublished' => array('unpublished', 1),
'show_archived' => array('archived', 0),
'show_trash' => array('trash', 0),
'show_all' => array('all', 0),
);
foreach ($configMap as $attribute => $preferences)
{
list($configKey, $default) = $preferences;
switch (strtolower($this->element[$attribute]))
{
case 'true':
case '1':
case 'yes':
$config[$configKey] = true;
case 'false':
case '0':
case 'no':
$config[$configKey] = false;
default:
$config[$configKey] = $default;
}
}
if ($config['published'])
{
$stack[] = JHtml::_('select.option', '1', JText::_('JPUBLISHED'));
}
if ($config['unpublished'])
{
$stack[] = JHtml::_('select.option', '0', JText::_('JUNPUBLISHED'));
}
if ($config['archived'])
{
$stack[] = JHtml::_('select.option', '2', JText::_('JARCHIVED'));
}
if ($config['trash'])
{
$stack[] = JHtml::_('select.option', '-2', JText::_('JTRASHED'));
}
if ($config['all'])
{
$stack[] = JHtml::_('select.option', '*', JText::_('JALL'));
}
return $stack;
}
/**
* Get the rendering of this field type for static display, e.g. in a single
* item view (typically a "read" task).
*
* @since 2.0
*
* @return string The field HTML
*/
public function getStatic()
{
$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
return '<span id="' . $this->id . '" ' . $class . '>' .
htmlspecialchars(F0FFormFieldList::getOptionName($this->getOptions(), $this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
/**
* Get the rendering of this field type for a repeatable (grid) display,
* e.g. in a view listing many item (typically a "browse" task)
*
* @since 2.0
*
* @return string The field HTML
*/
public function getRepeatable()
{
if (!($this->item instanceof F0FTable))
{
throw new Exception(__CLASS__ . ' needs a F0FTable to act upon');
}
// Initialise
$prefix = '';
$checkbox = 'cb';
$publish_up = null;
$publish_down = null;
$enabled = true;
// Get options
if ($this->element['prefix'])
{
$prefix = (string) $this->element['prefix'];
}
if ($this->element['checkbox'])
{
$checkbox = (string) $this->element['checkbox'];
}
if ($this->element['publish_up'])
{
$publish_up = (string) $this->element['publish_up'];
}
if ($this->element['publish_down'])
{
$publish_down = (string) $this->element['publish_down'];
}
// @todo Enforce ACL checks to determine if the field should be enabled or not
// Get the HTML
return JHTML::_('jgrid.published', $this->value, $this->rowid, $prefix, $enabled, $checkbox, $publish_up, $publish_down);
}
}
PK t!]���e�&