| Current Path : /home/w/u/e/wuectly/www/03cbe/ |
| Current File : /home/w/u/e/wuectly/www/03cbe/field.zip |
PK Ho!]�e��� � data.phpnu &1i� <?php
/**
* @package Joomla.Plugin
* @subpackage System.stats
*
* @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 $options Options available for this field.
* @var array $statsData Statistics that will be sent to the stats server
*/
JHtml::_('jquery.framework');
?>
<a href="#" onclick="jQuery(this).next().toggle(200); return false;"><?php echo JText::_('PLG_SYSTEM_STATS_MSG_WHAT_DATA_WILL_BE_SENT'); ?></a>
<?php
echo $field->render('stats', compact('statsData'));
PK Ho!]oT= uniqueid.phpnu &1i� <?php
/**
* @package Joomla.Plugin
* @subpackage System.stats
*
* @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 $options Options available for this field.
*/
?>
<input type="hidden" name="<?php echo $name; ?>" id="<?php echo $id; ?>" value="<?php echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>" />
<a class="btn" onclick="document.getElementById('<?php echo $id; ?>').value='';Joomla.submitbutton('plugin.apply');">
<span class="icon-refresh"></span> <?php echo JText::_('PLG_SYSTEM_STATS_RESET_UNIQUE_ID'); ?>
</a>PK .t!]�%�B� �
render.phpnu &1i� <?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @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;
if (!key_exists('field', $displayData))
{
return;
}
$field = $displayData['field'];
$label = JText::_($field->label);
$value = $field->value;
$class = $field->params->get('render_class');
$showLabel = $field->params->get('showlabel');
$labelClass = $field->params->get('label_render_class');
if ($field->context == 'com_contact.mail')
{
// Prepare the value for the contact form mail
$value = html_entity_decode($value);
echo ($showLabel ? $label . ': ' : '') . $value . "\r\n";
return;
}
if (!strlen($value))
{
return;
}
?>
<dt class="contact-field-entry <?php echo $class; ?>">
<?php if ($showLabel == 1) : ?>
<span class="field-label <?php echo $labelClass; ?>"><?php echo htmlentities($label, ENT_QUOTES | ENT_IGNORE, 'UTF-8'); ?>: </span>
<?php endif; ?>
</dt>
<dd class="contact-field-entry <?php echo $class; ?>">
<span class="field-value"><?php echo $value; ?></span>
</dd>
PK �t!]a�A A components.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
* Components installed on the site
*
* @package FrameworkOnFramework
* @since 2.1
*/
class F0FFormFieldComponents extends JFormFieldList implements F0FFormField
{
protected $static;
protected $repeatable;
public $client_ids = null;
/** @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.1
*/
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.1
*
* @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.1
*
* @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>';
}
/**
* Get a list of all installed components and also translates them.
*
* The manifest_cache is used to get the extension names, since JInstaller is also
* translating those names in stead of the name column. Else some of the translations
* fails.
*
* @since 2.1
*
* @return array An array of JHtml options.
*/
protected function getOptions()
{
$db = F0FPlatform::getInstance()->getDbo();
// Check for client_ids override
if ($this->client_ids !== null)
{
$client_ids = $this->client_ids;
}
else
{
$client_ids = $this->element['client_ids'];
}
$client_ids = explode(',', $client_ids);
// Calculate client_ids where clause
foreach ($client_ids as &$client_id)
{
$client_id = (int) trim($client_id);
$client_id = $db->q($client_id);
}
$query = $db->getQuery(true)
->select(
array(
$db->qn('name'),
$db->qn('element'),
$db->qn('client_id'),
$db->qn('manifest_cache'),
)
)
->from($db->qn('#__extensions'))
->where($db->qn('type') . ' = ' . $db->q('component'))
->where($db->qn('client_id') . ' IN (' . implode(',', $client_ids) . ')');
$db->setQuery($query);
$components = $db->loadObjectList('element');
// Convert to array of objects, so we can use sortObjects()
// Also translate component names with JText::_()
$aComponents = array();
$user = JFactory::getUser();
foreach ($components as $component)
{
// Don't show components in the list where the user doesn't have access for
// TODO: perhaps add an option for this
if (!$user->authorise('core.manage', $component->element))
{
continue;
}
$oData = (object) array(
'value' => $component->element,
'text' => $this->translate($component, 'component')
);
$aComponents[$component->element] = $oData;
}
// Reorder the components array, because the alphabetical
// ordering changed due to the JText::_() translation
uasort(
$aComponents,
function ($a, $b) {
return strcasecmp($a->text, $b->text);
}
);
return $aComponents;
}
/**
* Translate a list of objects with JText::_().
*
* @param array $item The array of objects
* @param string $type The extension type (e.g. component)
*
* @since 2.1
*
* @return string $text The translated name of the extension
*
* @see administrator/com_installer/models/extension.php
*/
public function translate($item, $type)
{
$platform = F0FPlatform::getInstance();
// Map the manifest cache to $item. This is needed to get the name from the
// manifest_cache and NOT from the name column, else some JText::_() translations fails.
$mData = json_decode($item->manifest_cache);
if ($mData)
{
foreach ($mData as $key => $value)
{
if ($key == 'type')
{
// Ignore the type field
continue;
}
$item->$key = $value;
}
}
$lang = $platform->getLanguage();
switch ($type)
{
case 'component':
$source = JPATH_ADMINISTRATOR . '/components/' . $item->element;
$lang->load("$item->element.sys", JPATH_ADMINISTRATOR, null, false, false)
|| $lang->load("$item->element.sys", $source, null, false, false)
|| $lang->load("$item->element.sys", JPATH_ADMINISTRATOR, $lang->getDefault(), false, false)
|| $lang->load("$item->element.sys", $source, $lang->getDefault(), false, false);
break;
}
$text = JText::_($item->name);
return $text;
}
}
PK �t!]Q=Т� � 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!]�kH� � password.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('password');
/**
* Form Field class for the F0F framework
* Supports a one line text field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldPassword extends JFormFieldPassword 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($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!]%}� � � accesslevel.phpnu &1i� <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @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('accesslevel');
/**
* Form Field class for F0F
* Joomla! access levels
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldAccesslevel extends JFormFieldAccessLevel implements F0FFormField
{
protected $static;
protected $repeatable;
/** @var int A monotonically increasing number, denoting the row number in a repeatable view */
public $rowid;
/** @var F0FTable The item being rendered in a repeatable form field */
public $item;
/**
* Method to get certain otherwise inaccessible properties from the form field object.
*
* @param string $name The property name for which to the the value.
*
* @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'] . '"' : '';
$params = $this->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();
// If params is an array, push these options to the array
if (is_array($params))
{
$options = array_merge($params, $options);
}
// If all levels is allowed, push it into the array.
elseif ($params)
{
array_unshift($options, JHtml::_('select.option', '', JText::_('JOPTION_ACCESS_SHOW_ALL_LEVELS')));
}
return '<span id="' . $this->id . '" ' . $class . '>' .
htmlspecialchars(F0FFormFieldList::getOptionName($options, $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'] : '';
$params = $this->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();
// If params is an array, push these options to the array
if (is_array($params))
{
$options = array_merge($params, $options);
}
// If all levels is allowed, push it into the array.
elseif ($params)
{
array_unshift($options, JHtml::_('select.option', '', JText::_('JOPTION_ACCESS_SHOW_ALL_LEVELS')));
}
return '<span class="' . $this->id . ' ' . $class . '">' .
htmlspecialchars(F0FFormFieldList::getOptionName($options, $this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK �t!]��/� � radio.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('radio');
/**
* Form Field class for F0F
* Radio selection list
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldRadio extends JFormFieldRadio 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!]Kn� � 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!] �x�� �
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!]Uw��
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!]�3Z}< < 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!]A�Ze e email.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('email');
/**
* Form Field class for the F0F framework
* Supports a one line text field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldEmail extends JFormFieldEMail 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'] . '"' : '';
$dolink = $this->element['show_link'] == 'true';
$empty_replacement = '';
if ($this->element['empty_replacement'])
{
$empty_replacement = (string) $this->element['empty_replacement'];
}
if (!empty($empty_replacement) && empty($this->value))
{
$this->value = JText::_($empty_replacement);
}
$innerHtml = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
if ($dolink)
{
$innerHtml = '<a href="mailto:' . $innerHtml . '">' .
$innerHtml . '</a>';
}
return '<span id="' . $this->id . '" ' . $class . '>' .
$innerHtml .
'</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()
{
// Initialise
$class = '';
$show_link = false;
$link_url = '';
$empty_replacement = '';
// Get field parameters
if ($this->element['class'])
{
$class = (string) $this->element['class'];
}
if ($this->element['show_link'] == 'true')
{
$show_link = true;
}
if ($this->element['url'])
{
$link_url = $this->element['url'];
}
else
{
$link_url = 'mailto:' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
}
if ($this->element['empty_replacement'])
{
$empty_replacement = (string) $this->element['empty_replacement'];
}
// Get the (optionally formatted) value
if (!empty($empty_replacement) && empty($this->value))
{
$this->value = JText::_($empty_replacement);
}
$value = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
// Create the HTML
$html = '<span class="' . $this->id . ' ' . $class . '">';
if ($show_link)
{
$html .= '<a href="' . $link_url . '">';
}
$html .= $value;
if ($show_link)
{
$html .= '</a>';
}
$html .= '</span>';
return $html;
}
}
PK �t!]e��nt t 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!]擁L
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!]�X� title.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('text');
/**
* Form Field class for the F0F framework
* Supports a title field with an optional slug display below it.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldTitle extends F0FFormFieldText implements F0FFormField
{
/**
* 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()
{
// Initialise
$slug_format = '(%s)';
$slug_class = 'small';
// Get field parameters
if ($this->element['slug_field'])
{
$slug_field = (string) $this->element['slug_field'];
}
else
{
$slug_field = $this->item->getColumnAlias('slug');
}
if ($this->element['slug_format'])
{
$slug_format = (string) $this->element['slug_format'];
}
if ($this->element['slug_class'])
{
$slug_class = (string) $this->element['slug_class'];
}
// Get the regular display
$html = parent::getRepeatable();
$slug = $this->item->$slug_field;
$html .= '<br />' . '<span class="' . $slug_class . '">';
$html .= JText::sprintf($slug_format, $slug);
$html .= '</span>';
return $html;
}
}
PK �t!]�5��d �d rules.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('rules');
/**
* Form Field class for F0F
* Joomla! ACL Rules
*
* @package FrameworkOnFramework
* @since 2.1
*/
class F0FFormFieldRules extends JFormFieldRules 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)
{
// This field cannot provide a static display
case 'static':
return '';
break;
// This field cannot provide a repeateable display
case 'repeatable':
return '';
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 '';
}
/**
* 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.1
*
* @return string The field HTML
*/
public function getRepeatable()
{
return '';
}
/**
* At the timing of this writing (2013-12-03), the Joomla "rules" field is buggy. When you are
* dealing with a new record it gets the default permissions from the root asset node, which
* is fine for the default permissions of Joomla articles, but unsuitable for third party software.
* We had to copy & paste the whole code, since we can't "inject" the correct asset id if one is
* not found. Our fixes are surrounded by `F0F Library fix` remarks.
*
* @return string The input field's HTML for this field type
*/
public function getInput()
{
if (version_compare(JVERSION, '3.0', 'ge'))
{
return $this->getInput3x();
}
else
{
return $this->getInput25();
}
}
protected function getInput25()
{
JHtml::_('behavior.tooltip');
// Initialise some field attributes.
$section = $this->element['section'] ? (string) $this->element['section'] : '';
$component = $this->element['component'] ? (string) $this->element['component'] : '';
$assetField = $this->element['asset_field'] ? (string) $this->element['asset_field'] : 'asset_id';
// Get the actions for the asset.
$actions = JAccess::getActions($component, $section);
// Iterate over the children and add to the actions.
foreach ($this->element->children() as $el)
{
if ($el->getName() == 'action')
{
$actions[] = (object) array('name' => (string) $el['name'], 'title' => (string) $el['title'],
'description' => (string) $el['description']);
}
}
// Get the explicit rules for this asset.
if ($section == 'component')
{
// Need to find the asset id by the name of the component.
$db = F0FPlatform::getInstance()->getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName('id'));
$query->from($db->quoteName('#__assets'));
$query->where($db->quoteName('name') . ' = ' . $db->quote($component));
$db->setQuery($query);
$assetId = (int) $db->loadResult();
if ($error = $db->getErrorMsg())
{
JError::raiseNotice(500, $error);
}
}
else
{
// Find the asset id of the content.
// Note that for global configuration, com_config injects asset_id = 1 into the form.
$assetId = $this->form->getValue($assetField);
// ==== F0F Library fix - Start ====
// If there is no assetId (let's say we are dealing with a new record), let's ask the table
// to give it to us. Here you should implement your logic (ie getting default permissions from
// the component or from the category)
if(!$assetId)
{
$table = $this->form->getModel()->getTable();
$assetId = $table->getAssetParentId();
}
// ==== F0F Library fix - End ====
}
// Use the compact form for the content rules (deprecated).
//if (!empty($component) && $section != 'component') {
// return JHtml::_('rules.assetFormWidget', $actions, $assetId, $assetId ? null : $component, $this->name, $this->id);
//}
// Full width format.
// Get the rules for just this asset (non-recursive).
$assetRules = JAccess::getAssetRules($assetId);
// Get the available user groups.
$groups = $this->getUserGroups();
// Build the form control.
$curLevel = 0;
// Prepare output
$html = array();
$html[] = '<div id="permissions-sliders" class="pane-sliders">';
$html[] = '<p class="rule-desc">' . JText::_('JLIB_RULES_SETTINGS_DESC') . '</p>';
$html[] = '<ul id="rules">';
// Start a row for each user group.
foreach ($groups as $group)
{
$difLevel = $group->level - $curLevel;
if ($difLevel > 0)
{
$html[] = '<li><ul>';
}
elseif ($difLevel < 0)
{
$html[] = str_repeat('</ul></li>', -$difLevel);
}
$html[] = '<li>';
$html[] = '<div class="panel">';
$html[] = '<h3 class="pane-toggler title"><a href="javascript:void(0);"><span>';
$html[] = str_repeat('<span class="level">|–</span> ', $curLevel = $group->level) . $group->text;
$html[] = '</span></a></h3>';
$html[] = '<div class="pane-slider content pane-hide">';
$html[] = '<div class="mypanel">';
$html[] = '<table class="group-rules">';
$html[] = '<thead>';
$html[] = '<tr>';
$html[] = '<th class="actions" id="actions-th' . $group->value . '">';
$html[] = '<span class="acl-action">' . JText::_('JLIB_RULES_ACTION') . '</span>';
$html[] = '</th>';
$html[] = '<th class="settings" id="settings-th' . $group->value . '">';
$html[] = '<span class="acl-action">' . JText::_('JLIB_RULES_SELECT_SETTING') . '</span>';
$html[] = '</th>';
// The calculated setting is not shown for the root group of global configuration.
$canCalculateSettings = ($group->parent_id || !empty($component));
if ($canCalculateSettings)
{
$html[] = '<th id="aclactionth' . $group->value . '">';
$html[] = '<span class="acl-action">' . JText::_('JLIB_RULES_CALCULATED_SETTING') . '</span>';
$html[] = '</th>';
}
$html[] = '</tr>';
$html[] = '</thead>';
$html[] = '<tbody>';
foreach ($actions as $action)
{
$html[] = '<tr>';
$html[] = '<td headers="actions-th' . $group->value . '">';
$html[] = '<label class="hasTip" for="' . $this->id . '_' . $action->name . '_' . $group->value . '" title="'
. htmlspecialchars(JText::_($action->title) . '::' . JText::_($action->description), ENT_COMPAT, 'UTF-8') . '">';
$html[] = JText::_($action->title);
$html[] = '</label>';
$html[] = '</td>';
$html[] = '<td headers="settings-th' . $group->value . '">';
$html[] = '<select name="' . $this->name . '[' . $action->name . '][' . $group->value . ']" id="' . $this->id . '_' . $action->name
. '_' . $group->value . '" title="'
. JText::sprintf('JLIB_RULES_SELECT_ALLOW_DENY_GROUP', JText::_($action->title), trim($group->text)) . '">';
$inheritedRule = JAccess::checkGroup($group->value, $action->name, $assetId);
// Get the actual setting for the action for this group.
$assetRule = $assetRules->allow($action->name, $group->value);
// Build the dropdowns for the permissions sliders
// The parent group has "Not Set", all children can rightly "Inherit" from that.
$html[] = '<option value=""' . ($assetRule === null ? ' selected="selected"' : '') . '>'
. JText::_(empty($group->parent_id) && empty($component) ? 'JLIB_RULES_NOT_SET' : 'JLIB_RULES_INHERITED') . '</option>';
$html[] = '<option value="1"' . ($assetRule === true ? ' selected="selected"' : '') . '>' . JText::_('JLIB_RULES_ALLOWED')
. '</option>';
$html[] = '<option value="0"' . ($assetRule === false ? ' selected="selected"' : '') . '>' . JText::_('JLIB_RULES_DENIED')
. '</option>';
$html[] = '</select>  ';
// If this asset's rule is allowed, but the inherited rule is deny, we have a conflict.
if (($assetRule === true) && ($inheritedRule === false))
{
$html[] = JText::_('JLIB_RULES_CONFLICT');
}
$html[] = '</td>';
// Build the Calculated Settings column.
// The inherited settings column is not displayed for the root group in global configuration.
if ($canCalculateSettings)
{
$html[] = '<td headers="aclactionth' . $group->value . '">';
// This is where we show the current effective settings considering currrent group, path and cascade.
// Check whether this is a component or global. Change the text slightly.
if (JAccess::checkGroup($group->value, 'core.admin', $assetId) !== true)
{
if ($inheritedRule === null)
{
$html[] = '<span class="icon-16-unset">' . JText::_('JLIB_RULES_NOT_ALLOWED') . '</span>';
}
elseif ($inheritedRule === true)
{
$html[] = '<span class="icon-16-allowed">' . JText::_('JLIB_RULES_ALLOWED') . '</span>';
}
elseif ($inheritedRule === false)
{
if ($assetRule === false)
{
$html[] = '<span class="icon-16-denied">' . JText::_('JLIB_RULES_NOT_ALLOWED') . '</span>';
}
else
{
$html[] = '<span class="icon-16-denied"><span class="icon-16-locked">' . JText::_('JLIB_RULES_NOT_ALLOWED_LOCKED')
. '</span></span>';
}
}
}
elseif (!empty($component))
{
$html[] = '<span class="icon-16-allowed"><span class="icon-16-locked">' . JText::_('JLIB_RULES_ALLOWED_ADMIN')
. '</span></span>';
}
else
{
// Special handling for groups that have global admin because they can't be denied.
// The admin rights can be changed.
if ($action->name === 'core.admin')
{
$html[] = '<span class="icon-16-allowed">' . JText::_('JLIB_RULES_ALLOWED') . '</span>';
}
elseif ($inheritedRule === false)
{
// Other actions cannot be changed.
$html[] = '<span class="icon-16-denied"><span class="icon-16-locked">'
. JText::_('JLIB_RULES_NOT_ALLOWED_ADMIN_CONFLICT') . '</span></span>';
}
else
{
$html[] = '<span class="icon-16-allowed"><span class="icon-16-locked">' . JText::_('JLIB_RULES_ALLOWED_ADMIN')
. '</span></span>';
}
}
$html[] = '</td>';
}
$html[] = '</tr>';
}
$html[] = '</tbody>';
$html[] = '</table></div>';
$html[] = '</div></div>';
$html[] = '</li>';
}
$html[] = str_repeat('</ul></li>', $curLevel);
$html[] = '</ul><div class="rule-notes">';
if ($section == 'component' || $section == null)
{
$html[] = JText::_('JLIB_RULES_SETTING_NOTES');
}
else
{
$html[] = JText::_('JLIB_RULES_SETTING_NOTES_ITEM');
}
$html[] = '</div></div>';
$js = "window.addEvent('domready', function(){ new Fx.Accordion($$('div#permissions-sliders.pane-sliders .panel h3.pane-toggler'),"
. "$$('div#permissions-sliders.pane-sliders .panel div.pane-slider'), {onActive: function(toggler, i) {toggler.addClass('pane-toggler-down');"
. "toggler.removeClass('pane-toggler');i.addClass('pane-down');i.removeClass('pane-hide');Cookie.write('jpanesliders_permissions-sliders"
. $component
. "',$$('div#permissions-sliders.pane-sliders .panel h3').indexOf(toggler));},"
. "onBackground: function(toggler, i) {toggler.addClass('pane-toggler');toggler.removeClass('pane-toggler-down');i.addClass('pane-hide');"
. "i.removeClass('pane-down');}, duration: 300, display: "
. JRequest::getInt('jpanesliders_permissions-sliders' . $component, 0, 'cookie') . ", show: "
. JRequest::getInt('jpanesliders_permissions-sliders' . $component, 0, 'cookie') . ", alwaysHide:true, opacity: false}); });";
JFactory::getDocument()->addScriptDeclaration($js);
return implode("\n", $html);
}
protected function getInput3x()
{
JHtml::_('bootstrap.tooltip');
// Initialise some field attributes.
$section = $this->section;
$component = $this->component;
$assetField = $this->assetField;
// Get the actions for the asset.
$actions = JAccess::getActions($component, $section);
// Iterate over the children and add to the actions.
foreach ($this->element->children() as $el)
{
if ($el->getName() == 'action')
{
$actions[] = (object) array('name' => (string) $el['name'], 'title' => (string) $el['title'],
'description' => (string) $el['description']);
}
}
// Get the explicit rules for this asset.
if ($section == 'component')
{
// Need to find the asset id by the name of the component.
$db = F0FPlatform::getInstance()->getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__assets'))
->where($db->quoteName('name') . ' = ' . $db->quote($component));
$assetId = (int) $db->setQuery($query)->loadResult();
}
else
{
// Find the asset id of the content.
// Note that for global configuration, com_config injects asset_id = 1 into the form.
$assetId = $this->form->getValue($assetField);
// ==== F0F Library fix - Start ====
// If there is no assetId (let's say we are dealing with a new record), let's ask the table
// to give it to us. Here you should implement your logic (ie getting default permissions from
// the component or from the category)
if(!$assetId)
{
$table = $this->form->getModel()->getTable();
$assetId = $table->getAssetParentId();
}
// ==== F0F Library fix - End ====
}
// Full width format.
// Get the rules for just this asset (non-recursive).
$assetRules = JAccess::getAssetRules($assetId);
// Get the available user groups.
$groups = $this->getUserGroups();
// Prepare output
$html = array();
// Description
$html[] = '<p class="rule-desc">' . JText::_('JLIB_RULES_SETTINGS_DESC') . '</p>';
// Begin tabs
$html[] = '<div id="permissions-sliders" class="tabbable tabs-left">';
// Building tab nav
$html[] = '<ul class="nav nav-tabs">';
foreach ($groups as $group)
{
// Initial Active Tab
$active = "";
if ($group->value == 1)
{
$active = "active";
}
$html[] = '<li class="' . $active . '">';
$html[] = '<a href="#permission-' . $group->value . '" data-toggle="tab">';
$html[] = str_repeat('<span class="level">–</span> ', $curLevel = $group->level) . $group->text;
$html[] = '</a>';
$html[] = '</li>';
}
$html[] = '</ul>';
$html[] = '<div class="tab-content">';
// Start a row for each user group.
foreach ($groups as $group)
{
// Initial Active Pane
$active = "";
if ($group->value == 1)
{
$active = " active";
}
$html[] = '<div class="tab-pane' . $active . '" id="permission-' . $group->value . '">';
$html[] = '<table class="table table-striped">';
$html[] = '<thead>';
$html[] = '<tr>';
$html[] = '<th class="actions" id="actions-th' . $group->value . '">';
$html[] = '<span class="acl-action">' . JText::_('JLIB_RULES_ACTION') . '</span>';
$html[] = '</th>';
$html[] = '<th class="settings" id="settings-th' . $group->value . '">';
$html[] = '<span class="acl-action">' . JText::_('JLIB_RULES_SELECT_SETTING') . '</span>';
$html[] = '</th>';
// The calculated setting is not shown for the root group of global configuration.
$canCalculateSettings = ($group->parent_id || !empty($component));
if ($canCalculateSettings)
{
$html[] = '<th id="aclactionth' . $group->value . '">';
$html[] = '<span class="acl-action">' . JText::_('JLIB_RULES_CALCULATED_SETTING') . '</span>';
$html[] = '</th>';
}
$html[] = '</tr>';
$html[] = '</thead>';
$html[] = '<tbody>';
foreach ($actions as $action)
{
$html[] = '<tr>';
$html[] = '<td headers="actions-th' . $group->value . '">';
$html[] = '<label for="' . $this->id . '_' . $action->name . '_' . $group->value . '" class="hasTooltip" title="'
. htmlspecialchars(JText::_($action->title) . ' ' . JText::_($action->description), ENT_COMPAT, 'UTF-8') . '">';
$html[] = JText::_($action->title);
$html[] = '</label>';
$html[] = '</td>';
$html[] = '<td headers="settings-th' . $group->value . '">';
$html[] = '<select class="input-small" name="' . $this->name . '[' . $action->name . '][' . $group->value . ']" id="' . $this->id . '_' . $action->name
. '_' . $group->value . '" title="'
. JText::sprintf('JLIB_RULES_SELECT_ALLOW_DENY_GROUP', JText::_($action->title), trim($group->text)) . '">';
$inheritedRule = JAccess::checkGroup($group->value, $action->name, $assetId);
// Get the actual setting for the action for this group.
$assetRule = $assetRules->allow($action->name, $group->value);
// Build the dropdowns for the permissions sliders
// The parent group has "Not Set", all children can rightly "Inherit" from that.
$html[] = '<option value=""' . ($assetRule === null ? ' selected="selected"' : '') . '>'
. JText::_(empty($group->parent_id) && empty($component) ? 'JLIB_RULES_NOT_SET' : 'JLIB_RULES_INHERITED') . '</option>';
$html[] = '<option value="1"' . ($assetRule === true ? ' selected="selected"' : '') . '>' . JText::_('JLIB_RULES_ALLOWED')
. '</option>';
$html[] = '<option value="0"' . ($assetRule === false ? ' selected="selected"' : '') . '>' . JText::_('JLIB_RULES_DENIED')
. '</option>';
$html[] = '</select>  ';
// If this asset's rule is allowed, but the inherited rule is deny, we have a conflict.
if (($assetRule === true) && ($inheritedRule === false))
{
$html[] = JText::_('JLIB_RULES_CONFLICT');
}
$html[] = '</td>';
// Build the Calculated Settings column.
// The inherited settings column is not displayed for the root group in global configuration.
if ($canCalculateSettings)
{
$html[] = '<td headers="aclactionth' . $group->value . '">';
// This is where we show the current effective settings considering currrent group, path and cascade.
// Check whether this is a component or global. Change the text slightly.
if (JAccess::checkGroup($group->value, 'core.admin', $assetId) !== true)
{
if ($inheritedRule === null)
{
$html[] = '<span class="label label-important">' . JText::_('JLIB_RULES_NOT_ALLOWED') . '</span>';
}
elseif ($inheritedRule === true)
{
$html[] = '<span class="label label-success">' . JText::_('JLIB_RULES_ALLOWED') . '</span>';
}
elseif ($inheritedRule === false)
{
if ($assetRule === false)
{
$html[] = '<span class="label label-important">' . JText::_('JLIB_RULES_NOT_ALLOWED') . '</span>';
}
else
{
$html[] = '<span class="label"><i class="icon-lock icon-white"></i> ' . JText::_('JLIB_RULES_NOT_ALLOWED_LOCKED')
. '</span>';
}
}
}
elseif (!empty($component))
{
$html[] = '<span class="label label-success"><i class="icon-lock icon-white"></i> ' . JText::_('JLIB_RULES_ALLOWED_ADMIN')
. '</span>';
}
else
{
// Special handling for groups that have global admin because they can't be denied.
// The admin rights can be changed.
if ($action->name === 'core.admin')
{
$html[] = '<span class="label label-success">' . JText::_('JLIB_RULES_ALLOWED') . '</span>';
}
elseif ($inheritedRule === false)
{
// Other actions cannot be changed.
$html[] = '<span class="label label-important"><i class="icon-lock icon-white"></i> '
. JText::_('JLIB_RULES_NOT_ALLOWED_ADMIN_CONFLICT') . '</span>';
}
else
{
$html[] = '<span class="label label-success"><i class="icon-lock icon-white"></i> ' . JText::_('JLIB_RULES_ALLOWED_ADMIN')
. '</span>';
}
}
$html[] = '</td>';
}
$html[] = '</tr>';
}
$html[] = '</tbody>';
$html[] = '</table></div>';
}
$html[] = '</div></div>';
$html[] = '<div class="alert">';
if ($section == 'component' || $section == null)
{
$html[] = JText::_('JLIB_RULES_SETTING_NOTES');
}
else
{
$html[] = JText::_('JLIB_RULES_SETTING_NOTES_ITEM');
}
$html[] = '</div>';
return implode("\n", $html);
}
}
PK �t!]
��;� � groupedbutton.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 F0FFormFieldGroupedbutton extends JFormFieldText 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();
}
/**
* 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 getInput()
{
$class = $this->element['class'] ? (string) $this->element['class'] : '';
$html = '<div id="' . $this->id . '" class="btn-group ' . $class . '">';
foreach ($this->element->children() as $option)
{
$renderedAttributes = array();
foreach ($option->attributes() as $name => $value)
{
if (!is_null($value))
{
$renderedAttributes[] = $name . '="' . htmlentities($value) . '"';
}
}
$buttonXML = new SimpleXMLElement('<field ' . implode(' ', $renderedAttributes) . ' />');
$buttonField = new F0FFormFieldButton($this->form);
// Pass required objects to the field
$buttonField->item = $this->item;
$buttonField->rowid = $this->rowid;
$buttonField->setup($buttonXML, null);
$html .= $buttonField->getRepeatable();
}
$html .= '</div>';
return $html;
}
}
PK �t!]Z��I� � checkbox.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('checkbox');
/**
* Form Field class for the F0F framework
* A single checkbox
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldCheckbox extends JFormFieldCheckbox 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'] . '"' : '';
$value = $this->element['value'] ? (string) $this->element['value'] : '1';
$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
$onclick = $this->element['onclick'] ? ' onclick="' . (string) $this->element['onclick'] . '"' : '';
$required = $this->required ? ' required="required" aria-required="true"' : '';
if (empty($this->value))
{
$checked = (isset($this->element['checked'])) ? ' checked="checked"' : '';
}
else
{
$checked = ' checked="checked"';
}
return '<span id="' . $this->id . '" ' . $class . '>' .
'<input type="checkbox" name="' . $this->name . '" id="' . $this->id . '"' . ' value="'
. htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"' . $class . $checked . $disabled . $onclick . $required . ' />' .
'</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'] : '';
$value = $this->element['value'] ? (string) $this->element['value'] : '1';
$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
$onclick = $this->element['onclick'] ? ' onclick="' . (string) $this->element['onclick'] . '"' : '';
$required = $this->required ? ' required="required" aria-required="true"' : '';
if (empty($this->value))
{
$checked = (isset($this->element['checked'])) ? ' checked="checked"' : '';
}
else
{
$checked = ' checked="checked"';
}
return '<span class="' . $this->id . ' ' . $class . '">' .
'<input type="checkbox" name="' . $this->name . '" class="' . $this->id . ' ' . $class . '"' . ' value="'
. htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"' . $checked . $disabled . $onclick . $required . ' />' .
'</span>';
}
}
PK �t!]6˟� �
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!]��ν� � 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!]��AI� � 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!]����
�
tel.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('tel');
/**
* Form Field class for the F0F framework
* Supports a URL text field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldTel extends JFormFieldTel 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'] . '"' : '';
$dolink = $this->element['show_link'] == 'true';
$empty_replacement = '';
if ($this->element['empty_replacement'])
{
$empty_replacement = (string) $this->element['empty_replacement'];
}
if (!empty($empty_replacement) && empty($this->value))
{
$this->value = JText::_($empty_replacement);
}
$innerHtml = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
if ($dolink)
{
$innerHtml = '<a href="tel:' . $innerHtml . '">' .
$innerHtml . '</a>';
}
return '<span id="' . $this->id . '" ' . $class . '>' .
$innerHtml .
'</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()
{
// Initialise
$class = $this->id;
$show_link = false;
$empty_replacement = '';
$link_url = 'tel:' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
// Get field parameters
if ($this->element['class'])
{
$class = ' ' . (string) $this->element['class'];
}
if ($this->element['show_link'] == 'true')
{
$show_link = true;
}
if ($this->element['empty_replacement'])
{
$empty_replacement = (string) $this->element['empty_replacement'];
}
// Get the (optionally formatted) value
if (!empty($empty_replacement) && empty($this->value))
{
$this->value = JText::_($empty_replacement);
}
$value = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
// Create the HTML
$html = '<span class="' . $class . '">';
if ($show_link)
{
$html .= '<a href="' . $link_url . '">';
}
$html .= $value;
if ($show_link)
{
$html .= '</a>';
}
$html .= '</span>';
return $html;
}
}
PK �t!]��]� � text.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('text');
/**
* Form Field class for the F0F framework
* Supports a one line text field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldText extends JFormFieldText 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'] . '"' : '';
$empty_replacement = '';
if ($this->element['empty_replacement'])
{
$empty_replacement = (string) $this->element['empty_replacement'];
}
if (!empty($empty_replacement) && empty($this->value))
{
$this->value = JText::_($empty_replacement);
}
return '<span id="' . $this->id . '" ' . $class . '>' .
htmlspecialchars($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()
{
// Initialise
$class = $this->id;
$format_string = '';
$format_if_not_empty = false;
$parse_value = false;
$show_link = false;
$link_url = '';
$empty_replacement = '';
// Get field parameters
if ($this->element['class'])
{
$class = (string) $this->element['class'];
}
if ($this->element['format'])
{
$format_string = (string) $this->element['format'];
}
if ($this->element['show_link'] == 'true')
{
$show_link = true;
}
if ($this->element['format_if_not_empty'] == 'true')
{
$format_if_not_empty = true;
}
if ($this->element['parse_value'] == 'true')
{
$parse_value = true;
}
if ($this->element['url'])
{
$link_url = $this->element['url'];
}
else
{
$show_link = false;
}
if ($show_link && ($this->item instanceof F0FTable))
{
$link_url = $this->parseFieldTags($link_url);
}
else
{
$show_link = false;
}
if ($this->element['empty_replacement'])
{
$empty_replacement = (string) $this->element['empty_replacement'];
}
// Get the (optionally formatted) value
$value = $this->value;
if (!empty($empty_replacement) && empty($this->value))
{
$value = JText::_($empty_replacement);
}
if ($parse_value)
{
$value = $this->parseFieldTags($value);
}
if (!empty($format_string) && (!$format_if_not_empty || ($format_if_not_empty && !empty($this->value))))
{
$format_string = $this->parseFieldTags($format_string);
$value = sprintf($format_string, $value);
}
else
{
$value = htmlspecialchars($value, ENT_COMPAT, 'UTF-8');
}
// Create the HTML
$html = '<span class="' . $class . '">';
if ($show_link)
{
$html .= '<a href="' . $link_url . '">';
}
$html .= $value;
if ($show_link)
{
$html .= '</a>';
}
$html .= '</span>';
return $html;
}
/**
* 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 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!]�bd� � 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;
/**
* Form Field class for F0F
* Renders the row ordering interface checkbox in browse views
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldOrdering extends JFormField 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 input markup for this field type.
*
* @since 2.0
*
* @return string The field input markup.
*/
protected function getInput()
{
$html = array();
$attr = '';
// Initialize some field attributes.
$attr .= !empty($this->class) ? ' class="' . $this->class . '"' : '';
$attr .= $this->disabled ? ' disabled' : '';
$attr .= !empty($this->size) ? ' size="' . $this->size . '"' : '';
// Initialize JavaScript field attributes.
$attr .= !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : '';
$this->item = $this->form->getModel()->getItem();
$keyfield = $this->item->getKeyName();
$itemId = $this->item->$keyfield;
$query = $this->getQuery();
// Create a read-only list (no name) with a hidden input to store the value.
if ($this->readonly)
{
$html[] = JHtml::_('list.ordering', '', $query, trim($attr), $this->value, $itemId ? 0 : 1);
$html[] = '<input type="hidden" name="' . $this->name . '" value="' . $this->value . '"/>';
}
else
{
// Create a regular list.
$html[] = JHtml::_('list.ordering', $this->name, $query, trim($attr), $this->value, $itemId ? 0 : 1);
}
return implode($html);
}
/**
* 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()
{
throw new Exception(__CLASS__ . ' cannot be used in single item display forms');
}
/**
* 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');
}
$class = isset($this->element['class']) ? $this->element['class'] : 'input-mini';
$icon = isset($this->element['icon']) ? $this->element['icon'] : 'icon-menu';
$html = '';
$view = $this->form->getView();
$ordering = $view->getLists()->order == 'ordering';
if (!$view->hasAjaxOrderingSupport())
{
// Ye olde Joomla! 2.5 method
$disabled = $ordering ? '' : 'disabled="disabled"';
$html .= '<span>';
$html .= $view->pagination->orderUpIcon($this->rowid, true, 'orderup', 'Move Up', $ordering);
$html .= '</span><span>';
$html .= $view->pagination->orderDownIcon($this->rowid, $view->pagination->total, true, 'orderdown', 'Move Down', $ordering);
$html .= '</span>';
$html .= '<input type="text" name="order[]" size="5" value="' . $this->value . '" ' . $disabled;
$html .= 'class="text-area-order" style="text-align: center" />';
}
else
{
// The modern drag'n'drop method
if ($view->getPerms()->editstate)
{
$disableClassName = '';
$disabledLabel = '';
$hasAjaxOrderingSupport = $view->hasAjaxOrderingSupport();
if (!$hasAjaxOrderingSupport['saveOrder'])
{
$disabledLabel = JText::_('JORDERINGDISABLED');
$disableClassName = 'inactive tip-top';
}
$orderClass = $ordering ? 'order-enabled' : 'order-disabled';
$html .= '<div class="' . $orderClass . '">';
$html .= '<span class="sortable-handler ' . $disableClassName . '" title="' . $disabledLabel . '" rel="tooltip">';
$html .= '<i class="' . $icon . '"></i>';
$html .= '</span>';
if ($ordering)
{
$html .= '<input type="text" name="order[]" size="5" class="' . $class . ' text-area-order" value="' . $this->value . '" />';
}
$html .= '</div>';
}
else
{
$html .= '<span class="sortable-handler inactive" >';
$html .= '<i class="' . $icon . '"></i>';
$html .= '</span>';
}
}
return $html;
}
/**
* Builds the query for the ordering list.
*
* @since 2.3.2
*
* @return F0FDatabaseQuery The query for the ordering form field
*/
protected function getQuery()
{
$ordering = $this->name;
$title = $this->element['ordertitle'] ? (string) $this->element['ordertitle'] : $this->item->getColumnAlias('title');
$db = F0FPlatform::getInstance()->getDbo();
$query = $db->getQuery(true);
$query->select(array($db->quoteName($ordering, 'value'), $db->quoteName($title, 'text')))
->from($db->quoteName($this->item->getTableName()))
->order($ordering);
return $query;
}
}
PK �t!]��@� �
hidden.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('hidden');
/**
* Form Field class for the F0F framework
* A hidden field
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldHidden extends JFormFieldHidden 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!]��0 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;
JFormHelper::loadFieldClass('list');
/**
* Form Field class for F0F
* Generic list from a model's results
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldModel extends F0FFormFieldList implements F0FFormField
{
protected $static;
protected $repeatable;
/**
* 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->id;
$format_string = '';
$show_link = false;
$link_url = '';
$empty_replacement = '';
// Get field parameters
if ($this->element['class'])
{
$class = (string) $this->element['class'];
}
if ($this->element['format'])
{
$format_string = (string) $this->element['format'];
}
if ($this->element['show_link'] == 'true')
{
$show_link = true;
}
if ($this->element['url'])
{
$link_url = $this->element['url'];
}
else
{
$show_link = false;
}
if ($show_link && ($this->item instanceof F0FTable))
{
$link_url = $this->parseFieldTags($link_url);
}
else
{
$show_link = false;
}
if ($this->element['empty_replacement'])
{
$empty_replacement = (string) $this->element['empty_replacement'];
}
$value = F0FFormFieldList::getOptionName($this->getOptions(), $this->value);
// Get the (optionally formatted) value
if (!empty($empty_replacement) && empty($value))
{
$value = JText::_($empty_replacement);
}
if (empty($format_string))
{
$value = htmlspecialchars($value, ENT_COMPAT, 'UTF-8');
}
else
{
$value = sprintf($format_string, $value);
}
// Create the HTML
$html = '<span class="' . $class . '">';
if ($show_link)
{
$html .= '<a href="' . $link_url . '">';
}
$html .= $value;
if ($show_link)
{
$html .= '</a>';
}
$html .= '</span>';
return $html;
}
/**
* 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'];
$translate = $this->element['translate'] ? (string) $this->element['translate'] : false;
$applyAccess = $this->element['apply_access'] ? (string) $this->element['apply_access'] : 'false';
$modelName = (string) $this->element['model'];
$nonePlaceholder = (string) $this->element['none'];
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;
}
/**
* 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 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!]n]ɯ�
�
checkboxes.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('checkboxes');
/**
* Form Field class for F0F
* Supports a list of checkbox.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldCheckboxes extends JFormFieldCheckboxes 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->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;
$translate = $this->element['translate'] ? (string) $this->element['translate'] : false;
$html = '<span class="' . $class . '">';
foreach ($this->value as $value) {
$html .= '<span>';
if ($translate == true)
{
$html .= JText::_($value);
}
else
{
$html .= $value;
}
$html .= '</span>';
}
$html .= '</span>';
}
/**
* 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 getInput()
{
// Used for J! 2.5 compatibility
$this->value = !is_array($this->value) ? explode(',', $this->value) : $this->value;
return parent::getInput();
}
}
PK �t!]�hq* * 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!]�e�3o o user.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('user');
/**
* Form Field class for the F0F framework
* A user selection box / display field
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldUser extends JFormFieldUser 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()
{
// Initialise
$show_username = true;
$show_email = false;
$show_name = false;
$show_id = false;
$class = '';
// Get the field parameters
if ($this->element['class'])
{
$class = ' class="' . (string) $this->element['class'] . '"';
}
if ($this->element['show_username'] == 'false')
{
$show_username = false;
}
if ($this->element['show_email'] == 'true')
{
$show_email = true;
}
if ($this->element['show_name'] == 'true')
{
$show_name = true;
}
if ($this->element['show_id'] == 'true')
{
$show_id = true;
}
// Get the user record
$user = JFactory::getUser($this->value);
// Render the HTML
$html = '<div id="' . $this->id . '" ' . $class . '>';
if ($show_username)
{
$html .= '<span class="fof-userfield-username">' . $user->username . '</span>';
}
if ($show_id)
{
$html .= '<span class="fof-userfield-id">' . $user->id . '</span>';
}
if ($show_name)
{
$html .= '<span class="fof-userfield-name">' . $user->name . '</span>';
}
if ($show_email)
{
$html .= '<span class="fof-userfield-email">' . $user->email . '</span>';
}
$html .= '</div>';
return $html;
}
/**
* 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()
{
// Initialise
$show_username = true;
$show_email = true;
$show_name = true;
$show_id = true;
$show_avatar = true;
$show_link = false;
$link_url = null;
$avatar_method = 'gravatar';
$avatar_size = 64;
$class = '';
// Get the user record
$user = JFactory::getUser($this->value);
// Get the field parameters
if ($this->element['class'])
{
$class = ' class="' . (string) $this->element['class'] . '"';
}
if ($this->element['show_username'] == 'false')
{
$show_username = false;
}
if ($this->element['show_email'] == 'false')
{
$show_email = false;
}
if ($this->element['show_name'] == 'false')
{
$show_name = false;
}
if ($this->element['show_id'] == 'false')
{
$show_id = false;
}
if ($this->element['show_avatar'] == 'false')
{
$show_avatar = false;
}
if ($this->element['avatar_method'])
{
$avatar_method = strtolower($this->element['avatar_method']);
}
if ($this->element['avatar_size'])
{
$avatar_size = $this->element['avatar_size'];
}
if ($this->element['show_link'] == 'true')
{
$show_link = true;
}
if ($this->element['link_url'])
{
$link_url = $this->element['link_url'];
}
else
{
if (F0FPlatform::getInstance()->isBackend())
{
// If no link is defined in the back-end, assume the user edit
// link in the User Manager component
$link_url = 'index.php?option=com_users&task=user.edit&id=[USER:ID]';
}
else
{
// If no link is defined in the front-end, we can't create a
// default link. Therefore, show no link.
$show_link = false;
}
}
// Post-process the link URL
if ($show_link)
{
$replacements = array(
'[USER:ID]' => $user->id,
'[USER:USERNAME]' => $user->username,
'[USER:EMAIL]' => $user->email,
'[USER:NAME]' => $user->name,
);
foreach ($replacements as $key => $value)
{
$link_url = str_replace($key, $value, $link_url);
}
}
// Get the avatar image, if necessary
if ($show_avatar)
{
$avatar_url = '';
if ($avatar_method == 'plugin')
{
// Use the user plugins to get an avatar
F0FPlatform::getInstance()->importPlugin('user');
$jResponse = F0FPlatform::getInstance()->runPlugins('onUserAvatar', array($user, $avatar_size));
if (!empty($jResponse))
{
foreach ($jResponse as $response)
{
if ($response)
{
$avatar_url = $response;
}
}
}
if (empty($avatar_url))
{
$show_avatar = false;
}
}
else
{
// Fall back to the Gravatar method
$md5 = md5($user->email);
if (F0FPlatform::getInstance()->isCli())
{
$scheme = 'http';
}
else
{
$scheme = JURI::getInstance()->getScheme();
}
if ($scheme == 'http')
{
$avatar_url = 'http://www.gravatar.com/avatar/' . $md5 . '.jpg?s='
. $avatar_size . '&d=mm';
}
else
{
$avatar_url = 'https://secure.gravatar.com/avatar/' . $md5 . '.jpg?s='
. $avatar_size . '&d=mm';
}
}
}
// Generate the HTML
$html = '<div id="' . $this->id . '" ' . $class . '>';
if ($show_avatar)
{
$html .= '<img src="' . $avatar_url . '" align="left" class="fof-usersfield-avatar" />';
}
if ($show_link)
{
$html .= '<a href="' . $link_url . '">';
}
if ($show_username)
{
$html .= '<span class="fof-usersfield-username">' . $user->username
. '</span>';
}
if ($show_id)
{
$html .= '<span class="fof-usersfield-id">' . $user->id
. '</span>';
}
if ($show_name)
{
$html .= '<span class="fof-usersfield-name">' . $user->name
. '</span>';
}
if ($show_email)
{
$html .= '<span class="fof-usersfield-email">' . $user->email
. '</span>';
}
if ($show_link)
{
$html .= '</a>';
}
$html .= '</div>';
return $html;
}
}
PK �t!]�.��� � integer.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('integer');
/**
* Form Field class for the F0F framework
* Supports a one line text field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldInteger extends JFormFieldInteger 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($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!]tPӤ�
�
url.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('url');
/**
* Form Field class for the F0F framework
* Supports a URL text field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldUrl extends JFormFieldUrl 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'] . '"' : '';
$dolink = $this->element['show_link'] == 'true';
$empty_replacement = '';
if ($this->element['empty_replacement'])
{
$empty_replacement = (string) $this->element['empty_replacement'];
}
if (!empty($empty_replacement) && empty($this->value))
{
$this->value = JText::_($empty_replacement);
}
$innerHtml = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
if ($dolink)
{
$innerHtml = '<a href="' . $innerHtml . '">' .
$innerHtml . '</a>';
}
return '<span id="' . $this->id . '" ' . $class . '>' .
$innerHtml .
'</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()
{
// Initialise
$class = $this->id;
$show_link = false;
$empty_replacement = '';
$link_url = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
// Get field parameters
if ($this->element['class'])
{
$class .= ' ' . (string) $this->element['class'];
}
if ($this->element['show_link'] == 'true')
{
$show_link = true;
}
if ($this->element['empty_replacement'])
{
$empty_replacement = (string) $this->element['empty_replacement'];
}
// Get the (optionally formatted) value
if (!empty($empty_replacement) && empty($this->value))
{
$this->value = JText::_($empty_replacement);
}
$value = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8');
// Create the HTML
$html = '<span class="' . $class . '">';
if ($show_link)
{
$html .= '<a href="' . $link_url . '">';
}
$html .= $value;
if ($show_link)
{
$html .= '</a>';
}
$html .= '</span>';
return $html;
}
}
PK �t!]����v v
button.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('text');
/**
* Form Field class for the F0F framework
* Supports a button input.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldButton extends F0FFormFieldText implements F0FFormField
{
protected $static;
protected $repeatable;
/**
* 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();
}
/**
* 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 getInput()
{
$this->label = '';
$allowedElement = array('button', 'a');
if (in_array($this->element['htmlelement'], $allowedElement))
$type = $this->element['htmlelement'];
else
$type = 'button';
$text = $this->element['text'];
$class = $this->element['class'] ? (string) $this->element['class'] : '';
$icon = $this->element['icon'] ? (string) $this->element['icon'] : '';
$onclick = $this->element['onclick'] ? 'onclick="' . (string) $this->element['onclick'] . '"' : '';
$url = $this->element['url'] ? 'href="' . $this->parseFieldTags((string) $this->element['url']) . '"' : '';
$title = $this->element['title'] ? 'title="' . JText::_((string) $this->element['title']) . '"' : '';
$this->value = JText::_($text);
if ($icon)
{
$icon = '<span class="icon ' . $icon . '"></span>';
}
return '<' . $type . ' id="' . $this->id . '" class="btn ' . $class . '" ' .
$onclick . $url . $title . '>' .
$icon .
htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') .
'</' . $type . '>';
}
/**
* Method to get the field title.
*
* @return string The field title.
*/
protected function getTitle()
{
return null;
}
}
PK �t!]��c? ? actions.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 F0FFormFieldActions extends JFormFieldList implements F0FFormField
{
protected $static;
protected $repeatable;
/** @var int A monotonically increasing number, denoting the row number in a repeatable view */
public $rowid;
/** @var F0FTable The item being rendered in a repeatable form field */
public $item;
/**
* Method to get certain otherwise inaccessible properties from the form field object.
*
* @param string $name The property name for which to the the value.
*
* @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 field configuration
*
* @return array
*/
protected function getConfig()
{
// If no custom options were defined let's figure out which ones of the
// defaults we shall use...
$config = array(
'published' => 1,
'unpublished' => 1,
'archived' => 0,
'trash' => 0,
'all' => 0,
);
$stack = array();
if (isset($this->element['show_published']))
{
$config['published'] = F0FStringUtils::toBool($this->element['show_published']);
}
if (isset($this->element['show_unpublished']))
{
$config['unpublished'] = F0FStringUtils::toBool($this->element['show_unpublished']);
}
if (isset($this->element['show_archived']))
{
$config['archived'] = F0FStringUtils::toBool($this->element['show_archived']);
}
if (isset($this->element['show_trash']))
{
$config['trash'] = F0FStringUtils::toBool($this->element['show_trash']);
}
if (isset($this->element['show_all']))
{
$config['all'] = F0FStringUtils::toBool($this->element['show_all']);
}
return $config;
}
/**
* Method to get the field options.
*
* @since 2.0
*
* @return array The field option objects.
*/
protected function getOptions()
{
return null;
}
/**
* Method to get a
*
* @param string $enabledFieldName Name of the enabled/published field
*
* @return F0FFormFieldPublished Field
*/
protected function getPublishedField($enabledFieldName)
{
$attributes = array(
'name' => $enabledFieldName,
'type' => 'published',
);
if ($this->element['publish_up'])
{
$attributes['publish_up'] = (string) $this->element['publish_up'];
}
if ($this->element['publish_down'])
{
$attributes['publish_down'] = (string) $this->element['publish_down'];
}
foreach ($attributes as $name => $value)
{
if (!is_null($value))
{
$renderedAttributes[] = $name . '="' . $value . '"';
}
}
$publishedXml = new SimpleXMLElement('<field ' . implode(' ', $renderedAttributes) . ' />');
$publishedField = new F0FFormFieldPublished($this->form);
// Pass required objects to the field
$publishedField->item = $this->item;
$publishedField->rowid = $this->rowid;
$publishedField->setup($publishedXml, $this->item->{$enabledFieldName});
return $publishedField;
}
/**
* 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()
{
throw new Exception(__CLASS__ . ' cannot be used in single item display forms');
}
/**
* 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');
}
$config = $this->getConfig();
// Initialise
$prefix = '';
$checkbox = 'cb';
$publish_up = null;
$publish_down = null;
$enabled = true;
$html = '<div class="btn-group">';
// Render a published field
if ($publishedFieldName = $this->item->getColumnAlias('enabled'))
{
if ($config['published'] || $config['unpublished'])
{
// Generate a F0FFormFieldPublished field
$publishedField = $this->getPublishedField($publishedFieldName);
// Render the publish button
$html .= $publishedField->getRepeatable();
}
if ($config['archived'])
{
$archived = $this->item->{$publishedFieldName} == 2 ? true : false;
// Create dropdown items
$action = $archived ? 'unarchive' : 'archive';
JHtml::_('actionsdropdown.' . $action, 'cb' . $this->rowid, $prefix);
}
if ($config['trash'])
{
$trashed = $this->item->{$publishedFieldName} == -2 ? true : false;
$action = $trashed ? 'untrash' : 'trash';
JHtml::_('actionsdropdown.' . $action, 'cb' . $this->rowid, $prefix);
}
// Render dropdown list
if ($config['archived'] || $config['trash'])
{
$html .= JHtml::_('actionsdropdown.render', $this->item->title);
}
}
$html .= '</div>';
return $html;
}
}
PK �t!]���e�&