Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/joomla4/ |
| [Home] [System Details] [Kill Me] |
PK.�[5�r���accesslevel.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('accesslevel');
/**
* Form Field class for FOF
* Joomla! access levels
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldAccesslevel extends JFormFieldAccessLevel implements
FOFFormField
{
protected $static;
protected $repeatable;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/** @var FOFTable 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 = FOFPlatform::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(FOFFormFieldList::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 = FOFPlatform::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(FOFFormFieldList::getOptionName($options,
$this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK.�[\����actions.phpnu�[���<?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
* @note This file has been modified by the Joomla! Project and no longer
reflects the original work of its author.
*/
// Protect from unauthorized access
defined('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('list');
/**
* Form Field class for FOF
* Supports a generic list of options.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldActions extends JFormFieldList implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/** @var FOFTable 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'] =
FOFStringUtils::toBool($this->element['show_published']);
}
if (isset($this->element['show_unpublished']))
{
$config['unpublished'] =
FOFStringUtils::toBool($this->element['show_unpublished']);
}
if (isset($this->element['show_archived']))
{
$config['archived'] =
FOFStringUtils::toBool($this->element['show_archived']);
}
if (isset($this->element['show_trash']))
{
$config['trash'] =
FOFStringUtils::toBool($this->element['show_trash']);
}
if (isset($this->element['show_all']))
{
$config['all'] =
FOFStringUtils::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 FOFFormFieldPublished 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 FOFFormFieldPublished($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 FOFTable))
{
throw new Exception(__CLASS__ . ' needs a FOFTable 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 FOFFormFieldPublished 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.�[[���vv
button.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('text');
/**
* Form Field class for the FOF framework
* Supports a button input.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldButton extends FOFFormFieldText implements FOFFormField
{
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.�[�d�^� � cachehandler.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('cachehandler');
/**
* Form Field class for FOF
* Joomla! cache handlers
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldCachehandler extends JFormFieldCacheHandler implements
FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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(FOFFormFieldList::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(FOFFormFieldList::getOptionName($this->getOptions(),
$this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK.�[y�I���calendar.phpnu�[���<?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
* @note This file has been modified by the Joomla! Project and no longer
reflects the original work of its author.
*/
// Protect from unauthorized access
defined('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('calendar');
/**
* Form Field class for the FOF framework
* Supports a calendar / date field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldCalendar extends JFormFieldCalendar implements
FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @since 2.0
*/
public function __get($name)
{
switch ($name)
{
// ATTENTION: Redirected getInput() to getStatic()
case 'input':
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->getCalendar('static');
}
/**
* 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->getCalendar('repeatable');
}
/**
* Method to get the calendar input markup.
*
* @param string $display The display to render ('static' or
'repeatable')
*
* @return string The field input markup.
*
* @since 2.1.rc4
*/
protected function getCalendar($display)
{
// Initialize some field attributes.
$format = $this->element['format'] ? (string)
$this->element['format'] : '%Y-%m-%d';
$class = $this->element['class'] ? (string)
$this->element['class'] : '';
$default = $this->element['default'] ? (string)
$this->element['default'] : '';
// PHP date doesn't use percentages (%) for the format, but the
calendar Javascript
// DOES use it (@see: calendar-uncompressed.js). Therefore we have to
convert it.
$formatJS = $format;
$formatPHP = str_replace(array('%', 'H:M:S',
'B'), array('', 'H:i:s', 'F'),
$formatJS);
// Check for empty date values
if (empty($this->value) || $this->value ==
FOFPlatform::getInstance()->getDbo()->getNullDate() ||
$this->value == '0000-00-00')
{
$this->value = $default;
}
// Get some system objects.
$config = FOFPlatform::getInstance()->getConfig();
$user = JFactory::getUser();
// Format date if exists
if (!empty($this->value))
{
$date = FOFPlatform::getInstance()->getDate($this->value,
'UTC');
// If a known filter is given use it.
switch (strtoupper((string) $this->element['filter']))
{
case 'SERVER_UTC':
// Convert a date to UTC based on the server timezone.
if ((int) $this->value)
{
// Get a date object based on the correct timezone.
$date->setTimezone(new
DateTimeZone($config->get('offset')));
}
break;
case 'USER_UTC':
// Convert a date to UTC based on the user timezone.
if ((int) $this->value)
{
// Get a date object based on the correct timezone.
$date->setTimezone($user->getTimezone());
}
break;
default:
break;
}
// Transform the date string.
$this->value = $date->format($formatPHP, true, false);
}
if ($display == 'static')
{
// Build the attributes array.
$attributes = array();
if ($this->element['size'])
{
$attributes['size'] = (int)
$this->element['size'];
}
if ($this->element['maxlength'])
{
$attributes['maxlength'] = (int)
$this->element['maxlength'];
}
if ($this->element['class'])
{
$attributes['class'] = (string)
$this->element['class'];
}
if ((string) $this->element['readonly'] ==
'true')
{
$attributes['readonly'] = 'readonly';
}
if ((string) $this->element['disabled'] ==
'true')
{
$attributes['disabled'] = 'disabled';
}
if ($this->element['onchange'])
{
$attributes['onchange'] = (string)
$this->element['onchange'];
}
if ($this->required)
{
$attributes['required'] = 'required';
$attributes['aria-required'] = 'true';
}
return JHtml::_('calendar', $this->value, $this->name,
$this->id, $formatJS, $attributes);
}
else
{
return '<span class="' . $this->id . ' '
. $class . '">' .
htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
}
PK.�[4�H��captcha.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('captcha');
/**
* Form Field class for the FOF framework
* Supports a captcha field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldCaptcha extends JFormFieldCaptcha implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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.�[ͮ�x��checkbox.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('checkbox');
/**
* Form Field class for the FOF framework
* A single checkbox
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldCheckbox extends JFormFieldCheckbox implements
FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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.�[tyR�
�
checkboxes.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('checkboxes');
/**
* Form Field class for FOF
* Supports a list of checkbox.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldCheckboxes extends JFormFieldCheckboxes implements
FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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/�[��&)��components.phpnu�[���<?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
* @note This file has been modified by the Joomla! Project and no longer
reflects the original work of its author.
*/
// Protect from unauthorized access
defined('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('list');
/**
* Form Field class for FOF
* Components installed on the site
*
* @package FrameworkOnFramework
* @since 2.1
*/
class FOFFormFieldComponents extends JFormFieldList implements FOFFormField
{
protected $static;
protected $repeatable;
public $client_ids = null;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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(FOFFormFieldList::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(FOFFormFieldList::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 = FOFPlatform::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 = FOFPlatform::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/�['b�
editor.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('editor');
/**
* Form Field class for the FOF framework
* An editarea field for content creation and formatted HTML display
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldEditor extends JFormFieldEditor implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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/�[i�ee email.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('email');
/**
* Form Field class for the FOF framework
* Supports a one line text field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldEmail extends JFormFieldEMail implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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/�[V����groupedbutton.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('list');
/**
* Form Field class for FOF
* Supports a generic list of options.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldGroupedbutton extends JFormFieldText implements
FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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 FOFFormFieldButton($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/�[́��**groupedlist.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('groupedlist');
/**
* Form Field class for FOF
* Supports a generic list of options.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldGroupedlist extends JFormFieldGroupedList implements
FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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 = FOFFormFieldList::getOptionName($data, $selected, $optKey,
$optText);
if (!is_null($match))
{
$ret = array(
'group' => $label,
'item' => $match
);
break;
}
}
return $ret;
}
}
PK/�[�Ll
��
hidden.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('hidden');
/**
* Form Field class for the FOF framework
* A hidden field
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldHidden extends JFormFieldHidden implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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/�[N�'"" image.phpnu�[���<?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('FOF_INCLUDED') or die;
/**
* Form Field class for the FOF framework
* Media selection field. This is an alias of the "media" field
type.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldImage extends FOFFormFieldMedia
{
}
PK/�[`��
imagelist.phpnu�[���<?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
* @note This file has been modified by the Joomla! Project and no longer
reflects the original work of its author.
*/
// Protect from unauthorized access
defined('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('imagelist');
/**
* Form Field class for the FOF framework
* Media selection field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldImagelist extends JFormFieldImageList implements
FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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()
{
$imgattr = array(
'id' => $this->id
);
if ($this->element['class'])
{
$imgattr['class'] = (string)
$this->element['class'];
}
if ($this->element['style'])
{
$imgattr['style'] = (string)
$this->element['style'];
}
if ($this->element['width'])
{
$imgattr['width'] = (string)
$this->element['width'];
}
if ($this->element['height'])
{
$imgattr['height'] = (string)
$this->element['height'];
}
if ($this->element['align'])
{
$imgattr['align'] = (string)
$this->element['align'];
}
if ($this->element['rel'])
{
$imgattr['rel'] = (string) $this->element['rel'];
}
if ($this->element['alt'])
{
$alt = JText::_((string) $this->element['alt']);
}
else
{
$alt = null;
}
if ($this->element['title'])
{
$imgattr['title'] = JText::_((string)
$this->element['title']);
}
$path = (string) $this->element['directory'];
$path = trim($path, '/' . DIRECTORY_SEPARATOR);
if ($this->value && file_exists(JPATH_ROOT . '/' .
$path . '/' . $this->value))
{
$src = FOFPlatform::getInstance()->URIroot() . '/' . $path
. '/' . $this->value;
}
else
{
$src = '';
}
return JHtml::_('image', $src, $alt, $imgattr);
}
/**
* 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/�[ �ut� � integer.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('integer');
/**
* Form Field class for the FOF framework
* Supports a one line text field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldInteger extends JFormFieldInteger implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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(FOFFormFieldList::getOptionName($this->getOptions(),
$this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK/�[� ه<<language.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('language');
/**
* Form Field class for FOF
* Available site languages
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldLanguage extends JFormFieldLanguage implements
FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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(FOFFormFieldList::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(FOFFormFieldList::getOptionName($this->getOptions(),
$this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK/�[t~�F'F'list.phpnu�[���<?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
* @note This file has been modified by the Joomla! Project and no longer
reflects the original work of its author.
*/
// Protect from unauthorized access
defined('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('list');
/**
* Form Field class for FOF
* Supports a generic list of options.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldList extends JFormFieldList implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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(self::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()
{
$show_link = false;
$link_url = '';
$class = $this->element['class'] ? (string)
$this->element['class'] : '';
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 FOFTable))
{
$link_url = $this->parseFieldTags($link_url);
}
else
{
$show_link = false;
}
$html = '<span class="' . $this->id . ' '
. $class . '">';
if ($show_link)
{
$html .= '<a href="' . $link_url .
'">';
}
$html .= htmlspecialchars(self::getOptionName($this->getOptions(),
$this->value), ENT_COMPAT, 'UTF-8');
if ($show_link)
{
$html .= '</a>';
}
$html .= '</span>';
return $html;
}
/**
* 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 $optKey Key name
* @param string $optText Value name
*
* @return mixed The label of the currently selected option
*/
public static function getOptionName($data, $selected = null, $optKey =
'value', $optText = 'text')
{
$ret = null;
foreach ($data as $elementKey => &$element)
{
if (is_array($element))
{
$key = $optKey === null ? $elementKey : $element[$optKey];
$text = $element[$optText];
}
elseif (is_object($element))
{
$key = $optKey === null ? $elementKey : $element->$optKey;
$text = $element->$optText;
}
else
{
// This is a simple associative array
$key = $elementKey;
$text = $element;
}
if (is_null($ret))
{
$ret = $text;
}
elseif ($selected == $key)
{
$ret = $text;
}
}
return $ret;
}
/**
* Method to get the field options.
*
* Ordering is disabled by default. You can enable ordering by setting the
* 'order' element in your form field. The other order values
are optional.
*
* - order What to order. Possible values: 'name' or
'value' (default = false)
* - order_dir Order direction. Possible values: 'asc' =
Ascending or 'desc' = Descending (default = 'asc')
* - order_case_sensitive Order case sensitive. Possible values:
'true' or 'false' (default = false)
*
* @return array The field option objects.
*
* @since Ordering is available since FOF 2.1.b2.
*/
protected function getOptions()
{
// Ordering is disabled by default for backward compatibility
$order = false;
// Set default order direction
$order_dir = 'asc';
// Set default value for case sensitive sorting
$order_case_sensitive = false;
if ($this->element['order'] &&
$this->element['order'] !== 'false')
{
$order = $this->element['order'];
}
if ($this->element['order_dir'])
{
$order_dir = $this->element['order_dir'];
}
if ($this->element['order_case_sensitive'])
{
// Override default setting when the form element value is
'true'
if ($this->element['order_case_sensitive'] ==
'true')
{
$order_case_sensitive = true;
}
}
// Create a $sortOptions array in order to apply sorting
$i = 0;
$sortOptions = array();
foreach ($this->element->children() as $option)
{
$name = JText::alt(trim((string) $option),
preg_replace('/[^a-zA-Z0-9_\-]/', '_',
$this->fieldname));
$sortOptions[$i] = new stdClass;
$sortOptions[$i]->option = $option;
$sortOptions[$i]->value = $option['value'];
$sortOptions[$i]->name = $name;
$i++;
}
// Only order if it's set
if ($order)
{
jimport('joomla.utilities.arrayhelper');
FOFUtilsArray::sortObjects($sortOptions, $order, $order_dir ==
'asc' ? 1 : -1, $order_case_sensitive, false);
}
// Initialise the options
$options = array();
// Get the field $options
foreach ($sortOptions as $sortOption)
{
$option = $sortOption->option;
$name = $sortOption->name;
// Only add <option /> elements.
if ($option->getName() != 'option')
{
continue;
}
$tmp = JHtml::_('select.option', (string)
$option['value'], $name, 'value', 'text',
((string) $option['disabled'] == 'true'));
// Set some option attributes.
$tmp->class = (string) $option['class'];
// Set some JavaScript option attributes.
$tmp->onclick = (string) $option['onclick'];
// Add the option object to the result set.
$options[] = $tmp;
}
// Do we have a class and method source for our options?
$source_file = empty($this->element['source_file']) ?
'' : (string) $this->element['source_file'];
$source_class = empty($this->element['source_class']) ?
'' : (string) $this->element['source_class'];
$source_method = empty($this->element['source_method']) ?
'' : (string) $this->element['source_method'];
$source_key = empty($this->element['source_key']) ?
'*' : (string) $this->element['source_key'];
$source_value = empty($this->element['source_value']) ?
'*' : (string) $this->element['source_value'];
$source_translate =
empty($this->element['source_translate']) ? 'true' :
(string) $this->element['source_translate'];
$source_translate = in_array(strtolower($source_translate),
array('true','yes','1','on')) ?
true : false;
$source_format = empty($this->element['source_format']) ?
'' : (string) $this->element['source_format'];
if ($source_class && $source_method)
{
// Maybe we have to load a file?
if (!empty($source_file))
{
$source_file = FOFTemplateUtils::parsePath($source_file, true);
if
(FOFPlatform::getInstance()->getIntegrationObject('filesystem')->fileExists($source_file))
{
include_once $source_file;
}
}
// Make sure the class exists
if (class_exists($source_class, true))
{
// ...and so does the option
if (in_array($source_method, get_class_methods($source_class)))
{
// Get the data from the class
if ($source_format == 'optionsobject')
{
$options = array_merge($options, $source_class::$source_method());
}
else
{
// Get the data from the class
$source_data = $source_class::$source_method();
// Loop through the data and prime the $options array
foreach ($source_data as $k => $v)
{
$key = (empty($source_key) || ($source_key == '*')) ? $k :
$v[$source_key];
$value = (empty($source_value) || ($source_value == '*'))
? $v : $v[$source_value];
if ($source_translate)
{
$value = JText::_($value);
}
$options[] = JHtml::_('select.option', $key, $value,
'value', 'text');
}
}
}
}
}
reset($options);
return $options;
}
/**
* 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/�[�E�
YY media.phpnu�[���<?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
* @note This file has been modified by the Joomla! Project and no longer
reflects the original work of its author.
*/
// Protect from unauthorized access
defined('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('media');
/**
* Form Field class for the FOF framework
* Media selection field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldMedia extends JFormFieldMedia implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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()
{
$imgattr = array(
'id' => $this->id
);
if ($this->element['class'])
{
$imgattr['class'] = (string)
$this->element['class'];
}
if ($this->element['style'])
{
$imgattr['style'] = (string)
$this->element['style'];
}
if ($this->element['width'])
{
$imgattr['width'] = (string)
$this->element['width'];
}
if ($this->element['height'])
{
$imgattr['height'] = (string)
$this->element['height'];
}
if ($this->element['align'])
{
$imgattr['align'] = (string)
$this->element['align'];
}
if ($this->element['rel'])
{
$imgattr['rel'] = (string) $this->element['rel'];
}
if ($this->element['alt'])
{
$alt = JText::_((string) $this->element['alt']);
}
else
{
$alt = null;
}
if ($this->element['title'])
{
$imgattr['title'] = JText::_((string)
$this->element['title']);
}
if ($this->value && file_exists(JPATH_ROOT . '/' .
$this->value))
{
$src = FOFPlatform::getInstance()->URIroot() . $this->value;
}
else
{
$src = '';
}
return JHtml::_('image', $src, $alt, $imgattr);
}
/**
* 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/�[7�Z� model.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('list');
/**
* Form Field class for FOF
* Generic list from a model's results
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldModel extends FOFFormFieldList implements FOFFormField
{
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(FOFFormFieldList::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 FOFTable))
{
$link_url = $this->parseFieldTags($link_url);
}
else
{
$show_link = false;
}
if ($this->element['empty_replacement'])
{
$empty_replacement = (string)
$this->element['empty_replacement'];
}
$value = FOFFormFieldList::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 = FOFInflector::explode($modelName);
$mName = ucfirst(array_pop($parts));
$mPrefix = FOFInflector::implode($parts);
// Get the model object
$config = array('savestate' => 0);
$model = FOFModel::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/�[�RҎ��ordering.phpnu�[���<?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('FOF_INCLUDED') or die;
/**
* Form Field class for FOF
* Renders the row ordering interface checkbox in browse views
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldOrdering extends JFormField implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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 FOFTable))
{
throw new Exception(__CLASS__ . ' needs a FOFTable 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 FOFDatabaseQuery 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 = FOFPlatform::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/�[���ؐ � password.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('password');
/**
* Form Field class for the FOF framework
* Supports a one line text field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldPassword extends JFormFieldPassword implements
FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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(FOFFormFieldList::getOptionName($this->getOptions(),
$this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK/�[N�'� � plugins.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('plugins');
/**
* Form Field class for FOF
* Plugins installed on the site
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldPlugins extends JFormFieldPlugins implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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(FOFFormFieldList::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(FOFFormFieldList::getOptionName($this->getOptions(),
$this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK/�[>1f��
published.phpnu�[���<?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
* @note This file has been modified by the Joomla! Project and no longer
reflects the original work of its author.
*/
// Protect from unauthorized access
defined('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('list');
/**
* Form Field class for FOF
* Supports a generic list of options.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldPublished extends JFormFieldList implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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(FOFFormFieldList::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 FOFTable))
{
throw new Exception(__CLASS__ . ' needs a FOFTable 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/�[Ȋ�}� � radio.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('radio');
/**
* Form Field class for FOF
* Radio selection list
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldRadio extends JFormFieldRadio implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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(FOFFormFieldList::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(FOFFormFieldList::getOptionName($this->getOptions(),
$this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK/�[�q]�ttrelation.phpnu�[���<?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('FOF_INCLUDED') or die;
/**
* Form Field class for FOF
* Relation list
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldRelation extends FOFFormFieldList
{
/**
* 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 FOFTable))
{
$link_url = false;
}
if ($this->element['empty_replacement'])
{
$empty_replacement = (string)
$this->element['empty_replacement'];
}
$relationName = FOFInflector::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 FOFInput;
$component = ucfirst(str_replace('com_', '',
$input->getString('option')));
$view = ucfirst($input->getString('view'));
$relation = FOFInflector::pluralize((string)
$this->element['name']);
$model = FOFModel::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 = FOFModel::getAnInstance($view)->getId())
{
$table = FOFTable::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/�[s�e�d�d rules.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('rules');
/**
* Form Field class for FOF
* Joomla! ACL Rules
*
* @package FrameworkOnFramework
* @since 2.1
*/
class FOFFormFieldRules extends JFormFieldRules implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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 `FOF 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 = FOFPlatform::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);
// ==== FOF 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();
}
// ==== FOF 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 = FOFPlatform::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);
// ==== FOF 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();
}
// ==== FOF 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/�[�l�:}}
selectrow.phpnu�[���<?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('FOF_INCLUDED') or die;
/**
* Form Field class for FOF
* Renders the checkbox in browse views which allows you to select rows
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldSelectrow extends JFormField implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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()
{
throw new Exception(__CLASS__ . ' cannot be used in input
forms');
}
/**
* 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 FOFTable))
{
throw new Exception(__CLASS__ . ' needs a FOFTable to act
upon');
}
// Is this record checked out?
$checked_out = false;
$locked_by_field =
$this->item->getColumnAlias('locked_by');
$myId = JFactory::getUser()->get('id', 0);
if (property_exists($this->item, $locked_by_field))
{
$locked_by = $this->item->$locked_by_field;
$checked_out = ($locked_by != 0 && $locked_by != $myId);
}
// Get the key id for this record
$key_field = $this->item->getKeyName();
$key_id = $this->item->$key_field;
// Get the HTML
return JHTML::_('grid.id', $this->rowid, $key_id,
$checked_out);
}
}
PK/�[�2�� � sessionhandler.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('sessionhandler');
/**
* Form Field class for FOF
* Joomla! session handlers
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldSessionhandler extends JFormFieldSessionHandler
implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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(FOFFormFieldList::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(FOFFormFieldList::getOptionName($this->getOptions(),
$this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK/�[3����
spacer.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('spacer');
/**
* Form Field class for the FOF framework
* Spacer used between form elements
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldSpacer extends JFormFieldSpacer implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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/�[���� � sql.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('sql');
/**
* Form Field class for FOF
* Radio selection listGeneric list from an SQL statement
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldSql extends JFormFieldSql implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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(FOFFormFieldList::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(FOFFormFieldList::getOptionName($this->getOptions(),
$this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK/�[i6R;��tag.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('tag');
/**
* Form Field class for FOF
* Tag Fields
*
* @package FrameworkOnFramework
* @since 2.1
*/
class FOFFormFieldTag extends JFormFieldTag implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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 a list of tags
*
* @return array The field option objects.
*
* @since 3.1
*/
protected function getOptions()
{
$options = array();
$published = $this->element['published']?
$this->element['published'] : array(0,1);
$db = FOFPlatform::getInstance()->getDbo();
$query = $db->getQuery(true)
->select('DISTINCT a.id AS value, a.path, a.title AS text,
a.level, a.published, a.lft')
->from('#__tags AS a')
->join('LEFT', $db->quoteName('#__tags') .
' AS b ON a.lft > b.lft AND a.rgt < b.rgt');
if ($this->item instanceof FOFTable)
{
$item = $this->item;
}
else
{
$item = $this->form->getModel()->getItem();
}
if ($item instanceof FOFTable)
{
// Fake value for selected tags
$keyfield = $item->getKeyName();
$content_id = $item->$keyfield;
$type = $item->getContentType();
$selected_query = $db->getQuery(true);
$selected_query
->select('tag_id')
->from('#__contentitem_tag_map')
->where('content_item_id = ' . (int) $content_id)
->where('type_alias = ' . $db->quote($type));
$db->setQuery($selected_query);
$this->value = $db->loadColumn();
}
// Filter language
if (!empty($this->element['language']))
{
$query->where('a.language = ' .
$db->quote($this->element['language']));
}
$query->where($db->qn('a.lft') . ' > 0');
// Filter to only load active items
// Filter on the published state
if (is_numeric($published))
{
$query->where('a.published = ' . (int) $published);
}
elseif (is_array($published))
{
FOFUtilsArray::toInteger($published);
$query->where('a.published IN (' . implode(',',
$published) . ')');
}
$query->order('a.lft ASC');
// Get the options.
$db->setQuery($query);
try
{
$options = $db->loadObjectList();
}
catch (RuntimeException $e)
{
return false;
}
// Prepare nested data
if ($this->isNested())
{
$this->prepareOptionsNested($options);
}
else
{
$options = JHelperTags::convertPathsToNames($options);
}
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'] ? (string)
$this->element['class'] : '';
$translate = $this->element['translate'] ? (string)
$this->element['translate'] : false;
$options = $this->getOptions();
$html = '';
foreach ($options as $option) {
$html .= '<span>';
if ($translate == true)
{
$html .= JText::_($option->text);
}
else
{
$html .= $option->text;
}
$html .= '</span>';
}
return '<span id="' . $this->id . '"
class="' . $class . '">' .
$html .
'</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'] : '';
$translate = $this->element['translate'] ? (string)
$this->element['translate'] : false;
$options = $this->getOptions();
$html = '';
foreach ($options as $option) {
$html .= '<span>';
if ($translate == true)
{
$html .= JText::_($option->text);
}
else
{
$html .= $option->text;
}
$html .= '</span>';
}
return '<span class="' . $this->id . ' ' .
$class . '">' .
$html .
'</span>';
}
}
PK/�[�#B\�
�
tel.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('tel');
/**
* Form Field class for the FOF framework
* Supports a URL text field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldTel extends JFormFieldTel implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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/�[ӧ@���text.phpnu�[���<?php
/**
* @package FrameworkOnFramework
* @subpackage model
* @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('FOF_INCLUDED') or die;
/**
* FrameworkOnFramework model behavior class
*
* @package FrameworkOnFramework
* @since 2.1
*/
class FOFModelFieldText extends FOFModelField
{
/**
* Constructor
*
* @param FOFDatabaseDriver $db The database object
* @param object $field The field informations as taken from
the db
*/
public function __construct($db, $field, $table_alias = false)
{
parent::__construct($db, $field, $table_alias);
$this->null_value = '';
}
/**
* Returns the default search method for this field.
*
* @return string
*/
public function getDefaultSearchMethod()
{
return 'partial';
}
/**
* Perform a partial match (search in string)
*
* @param mixed $value The value to compare to
*
* @return string The SQL where clause for this search
*/
public function partial($value)
{
if ($this->isEmpty($value))
{
return '';
}
return '(' . $this->getFieldName() . ' LIKE ' .
$this->_db->quote('%' . $value . '%') .
')';
}
/**
* Perform an exact match (match string)
*
* @param mixed $value The value to compare to
*
* @return string The SQL where clause for this search
*/
public function exact($value)
{
if ($this->isEmpty($value))
{
return '';
}
return '(' . $this->getFieldName() . ' LIKE ' .
$this->_db->quote($value) . ')';
}
/**
* Dummy method; this search makes no sense for text fields
*
* @param mixed $from Ignored
* @param mixed $to Ignored
* @param boolean $include Ignored
*
* @return string Empty string
*/
public function between($from, $to, $include = true)
{
return '';
}
/**
* Dummy method; this search makes no sense for text fields
*
* @param mixed $from Ignored
* @param mixed $to Ignored
* @param boolean $include Ignored
*
* @return string Empty string
*/
public function outside($from, $to, $include = false)
{
return '';
}
/**
* Dummy method; this search makes no sense for text fields
*
* @param mixed $value Ignored
* @param mixed $interval Ignored
* @param boolean $include Ignored
*
* @return string Empty string
*/
public function interval($value, $interval, $include = true)
{
return '';
}
/**
* Dummy method; this search makes no sense for text fields
*
* @param mixed $from Ignored
* @param mixed $to Ignored
* @param boolean $include Ignored
*
* @return string Empty string
*/
public function range($from, $to, $include = false)
{
return '';
}
/**
* Dummy method; this search makes no sense for text fields
*
* @param mixed $from Ignored
* @param mixed $to Ignored
* @param boolean $include Ignored
*
* @return string Empty string
*/
public function modulo($from, $to, $include = false)
{
return '';
}
}
PK/�[!9����textarea.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('textarea');
/**
* Form Field class for the FOF framework
* Supports a text area
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldTextarea extends JFormFieldTextarea implements
FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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 . '>' .
htmlspecialchars(nl2br($this->value), ENT_COMPAT, 'UTF-8')
.
'</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()
{
return $this->getStatic();
}
}
PK/�[���
timezone.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('timezone');
/**
* Form Field class for FOF
* Supports a generic list of options.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldTimezone extends JFormFieldTimezone implements
FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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 =
FOFFormFieldGroupedlist::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/�[�V� title.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('text');
/**
* Form Field class for the FOF framework
* Supports a title field with an optional slug display below it.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldTitle extends FOFFormFieldText implements FOFFormField
{
/**
* 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/�[xj���
�
url.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('url');
/**
* Form Field class for the FOF framework
* Supports a URL text field.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldUrl extends JFormFieldUrl implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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/�[(�oouser.phpnu�[���<?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('FOF_INCLUDED') or die;
JFormHelper::loadFieldClass('user');
/**
* Form Field class for the FOF framework
* A user selection box / display field
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldUser extends JFormFieldUser implements FOFFormField
{
protected $static;
protected $repeatable;
/** @var FOFTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form
field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @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 (FOFPlatform::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
FOFPlatform::getInstance()->importPlugin('user');
$jResponse =
FOFPlatform::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 (FOFPlatform::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/�[j���
�
usergroup.phpnu�[���<?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('_JEXEC') or die;
JFormHelper::loadFieldClass('usergroup');
/**
* Form Field class for FOF
* Joomla! user groups
*
* @package FrameworkOnFramework
* @since 2.0
*/
class FOFFormFieldUsergroup extends JFormFieldUsergroup implements
FOFFormField
{
protected $static;
protected $repeatable;
/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
public $rowid;
/** @var FOFTable 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 = FOFPlatform::getInstance()->getDbo();
$query = $db->getQuery(true);
$query->select('a.id AS value, a.title AS text');
$query->from('#__usergroups AS a');
$query->group('a.id, a.title');
$query->order('a.id 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(FOFFormFieldList::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'] : '';
$db = FOFPlatform::getInstance()->getDbo();
$query = $db->getQuery(true);
$query->select('a.id AS value, a.title AS text');
$query->from('#__usergroups AS a');
$query->group('a.id, a.title');
$query->order('a.id ASC');
$query->order($query->qn('title') . ' ASC');
// Get the options.
$db->setQuery($query);
$options = $db->loadObjectList();
return '<span class="' . $this->id . ' ' .
$class . '">' .
htmlspecialchars(FOFFormFieldList::getOptionName($options,
$this->value), ENT_COMPAT, 'UTF-8') .
'</span>';
}
}
PK|O�[�,]���boolean.phpnu�[���<?php
/**
* @package FrameworkOnFramework
* @subpackage model
* @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('FOF_INCLUDED') or die;
/**
* FrameworkOnFramework model behavior class
*
* @package FrameworkOnFramework
* @since 2.1
*/
class FOFModelFieldBoolean extends FOFModelFieldNumber
{
/**
* Is it a null or otherwise empty value?
*
* @param mixed $value The value to test for emptiness
*
* @return boolean
*/
public function isEmpty($value)
{
return is_null($value) || ($value === '');
}
}
PK|O�[ln�date.phpnu�[���<?php
/**
* @package FrameworkOnFramework
* @subpackage model
* @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('FOF_INCLUDED') or die;
/**
* FrameworkOnFramework model behavior class
*
* @package FrameworkOnFramework
* @since 2.1
*/
class FOFModelFieldDate extends FOFModelFieldText
{
/**
* Returns the default search method for this field.
*
* @return string
*/
public function getDefaultSearchMethod()
{
return 'exact';
}
/**
* Perform a between limits match. When $include is true
* the condition tested is:
* $from <= VALUE <= $to
* When $include is false the condition tested is:
* $from < VALUE < $to
*
* @param mixed $from The lowest value to compare to
* @param mixed $to The higherst value to compare to
* @param boolean $include Should we include the boundaries in the
search?
*
* @return string The SQL where clause for this search
*/
public function between($from, $to, $include = true)
{
if ($this->isEmpty($from) || $this->isEmpty($to))
{
return '';
}
$extra = '';
if ($include)
{
$extra = '=';
}
$sql = '((' . $this->getFieldName() . ' >' .
$extra . ' "' . $from . '") AND ';
$sql .= '(' . $this->getFieldName() . ' <' .
$extra . ' "' . $to . '"))';
return $sql;
}
/**
* Perform an outside limits match. When $include is true
* the condition tested is:
* (VALUE <= $from) || (VALUE >= $to)
* When $include is false the condition tested is:
* (VALUE < $from) || (VALUE > $to)
*
* @param mixed $from The lowest value of the excluded range
* @param mixed $to The higherst value of the excluded range
* @param boolean $include Should we include the boundaries in the
search?
*
* @return string The SQL where clause for this search
*/
public function outside($from, $to, $include = false)
{
if ($this->isEmpty($from) || $this->isEmpty($to))
{
return '';
}
$extra = '';
if ($include)
{
$extra = '=';
}
$sql = '((' . $this->getFieldName() . ' <' .
$extra . ' "' . $from . '") OR ';
$sql .= '(' . $this->getFieldName() . ' >' .
$extra . ' "' . $to . '"))';
return $sql;
}
/**
* Interval date search
*
* @param string $value The value to search
* @param string|array|object $interval The interval. Can be (+1 MONTH
or array('value' => 1, 'unit' =>
'MONTH', 'sign' => '+'))
* @param boolean $include If the borders should be
included
*
* @return string the sql string
*/
public function interval($value, $interval, $include = true)
{
if ($this->isEmpty($value) || $this->isEmpty($interval))
{
return '';
}
$interval = $this->getInterval($interval);
if ($interval['sign'] == '+')
{
$function = 'DATE_ADD';
}
else
{
$function = 'DATE_SUB';
}
$extra = '';
if ($include)
{
$extra = '=';
}
$sql = '(' . $this->getFieldName() . ' >' .
$extra . ' ' . $function;
$sql .= '(' . $this->getFieldName() . ', INTERVAL
' . $interval['value'] . ' ' .
$interval['unit'] . '))';
return $sql;
}
/**
* Perform a between limits match. When $include is true
* the condition tested is:
* $from <= VALUE <= $to
* When $include is false the condition tested is:
* $from < VALUE < $to
*
* @param mixed $from The lowest value to compare to
* @param mixed $to The higherst value to compare to
* @param boolean $include Should we include the boundaries in the
search?
*
* @return string The SQL where clause for this search
*/
public function range($from, $to, $include = true)
{
if ($this->isEmpty($from) && $this->isEmpty($to))
{
return '';
}
$extra = '';
if ($include)
{
$extra = '=';
}
if ($from)
$sql[] = '(' . $this->getFieldName() . ' >' .
$extra . ' "' . $from . '")';
if ($to)
$sql[] = '(' . $this->getFieldName() . ' <' .
$extra . ' "' . $to . '")';
$sql = '(' . implode(' AND ', $sql) . ')';
return $sql;
}
/**
* Parses an interval –which may be given as a string, array or
object– into
* a standardised hash array that can then be used bu the interval()
method.
*
* @param string|array|object $interval The interval expression to
parse
*
* @return array The parsed, hash array form of the interval
*/
protected function getInterval($interval)
{
if (is_string($interval))
{
if (strlen($interval) > 2)
{
$interval = explode(" ", $interval);
$sign = ($interval[0] == '-') ? '-' :
'+';
$value = (int) substr($interval[0], 1);
$interval = array(
'unit' => $interval[1],
'value' => $value,
'sign' => $sign
);
}
else
{
$interval = array(
'unit' => 'MONTH',
'value' => 1,
'sign' => '+'
);
}
}
else
{
$interval = (array) $interval;
}
return $interval;
}
}
PK|O�[��P�
number.phpnu�[���<?php
/**
* @package FrameworkOnFramework
* @subpackage model
* @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('FOF_INCLUDED') or die;
/**
* FrameworkOnFramework model behavior class
*
* @package FrameworkOnFramework
* @since 2.1
*/
class FOFModelFieldNumber extends FOFModelField
{
/**
* The partial match is mapped to an exact match
*
* @param mixed $value The value to compare to
*
* @return string The SQL where clause for this search
*/
public function partial($value)
{
return $this->exact($value);
}
/**
* Perform a between limits match. When $include is true
* the condition tested is:
* $from <= VALUE <= $to
* When $include is false the condition tested is:
* $from < VALUE < $to
*
* @param mixed $from The lowest value to compare to
* @param mixed $to The higherst value to compare to
* @param boolean $include Should we include the boundaries in the
search?
*
* @return string The SQL where clause for this search
*/
public function between($from, $to, $include = true)
{
if ($this->isEmpty($from) || $this->isEmpty($to))
{
return '';
}
$extra = '';
if ($include)
{
$extra = '=';
}
$sql = '((' . $this->getFieldName() . ' >' .
$extra . ' ' . $from . ') AND ';
$sql .= '(' . $this->getFieldName() . ' <' .
$extra . ' ' . $to . '))';
return $sql;
}
/**
* Perform an outside limits match. When $include is true
* the condition tested is:
* (VALUE <= $from) || (VALUE >= $to)
* When $include is false the condition tested is:
* (VALUE < $from) || (VALUE > $to)
*
* @param mixed $from The lowest value of the excluded range
* @param mixed $to The higherst value of the excluded range
* @param boolean $include Should we include the boundaries in the
search?
*
* @return string The SQL where clause for this search
*/
public function outside($from, $to, $include = false)
{
if ($this->isEmpty($from) || $this->isEmpty($to))
{
return '';
}
$extra = '';
if ($include)
{
$extra = '=';
}
$sql = '((' . $this->getFieldName() . ' <' .
$extra . ' ' . $from . ') OR ';
$sql .= '(' . $this->getFieldName() . ' >' .
$extra . ' ' . $to . '))';
return $sql;
}
/**
* Perform an interval match. It's similar to a 'between'
match, but the
* from and to values are calculated based on $value and $interval:
* $value - $interval < VALUE < $value + $interval
*
* @param integer|float $value The center value of the search space
* @param integer|float $interval The width of the search space
* @param boolean $include Should I include the boundaries in
the search?
*
* @return string The SQL where clause
*/
public function interval($value, $interval, $include = true)
{
if ($this->isEmpty($value))
{
return '';
}
$from = $value - $interval;
$to = $value + $interval;
$extra = '';
if ($include)
{
$extra = '=';
}
$sql = '((' . $this->getFieldName() . ' >' .
$extra . ' ' . $from . ') AND ';
$sql .= '(' . $this->getFieldName() . ' <' .
$extra . ' ' . $to . '))';
return $sql;
}
/**
* Perform a range limits match. When $include is true
* the condition tested is:
* $from <= VALUE <= $to
* When $include is false the condition tested is:
* $from < VALUE < $to
*
* @param mixed $from The lowest value to compare to
* @param mixed $to The higherst value to compare to
* @param boolean $include Should we include the boundaries in the
search?
*
* @return string The SQL where clause for this search
*/
public function range($from, $to, $include = true)
{
if ($this->isEmpty($from) && $this->isEmpty($to))
{
return '';
}
$extra = '';
if ($include)
{
$extra = '=';
}
if ($from)
$sql[] = '(' . $this->getFieldName() . ' >' .
$extra . ' ' . $from . ')';
if ($to)
$sql[] = '(' . $this->getFieldName() . ' <' .
$extra . ' ' . $to . ')';
$sql = '(' . implode(' AND ', $sql) . ')';
return $sql;
}
/**
* Perform an interval match. It's similar to a 'between'
match, but the
* from and to values are calculated based on $value and $interval:
* $value - $interval < VALUE < $value + $interval
*
* @param integer|float $value The starting value of the search
space
* @param integer|float $interval The interval period of the search
space
* @param boolean $include Should I include the boundaries in
the search?
*
* @return string The SQL where clause
*/
public function modulo($value, $interval, $include = true)
{
if ($this->isEmpty($value) || $this->isEmpty($interval))
{
return '';
}
$extra = '';
if ($include)
{
$extra = '=';
}
$sql = '(' . $this->getFieldName() . ' >' .
$extra . ' ' . $value . ' AND ';
$sql .= '(' . $this->getFieldName() . ' - ' .
$value . ') % ' . $interval . ' = 0)';
return $sql;
}
}
PK0\�[C�HHcategory.phpnu�[���<?php
/**
* @package Joomla.Legacy
* @subpackage Form
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
JFormHelper::loadFieldClass('list');
/**
* Form Field class for the Joomla Platform.
* Supports an HTML select list of categories
*
* @since 1.6
*/
class JFormFieldCategory extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
public $type = 'Category';
/**
* Method to get the field options for category
* Use the extension attribute in a form to specify the.specific extension
for
* which categories should be displayed.
* Use the show_root attribute to specify whether to show the global
category root in the list.
*
* @return array The field option objects.
*
* @since 1.6
*/
protected function getOptions()
{
$options = array();
$extension = $this->element['extension'] ? (string)
$this->element['extension'] : (string)
$this->element['scope'];
$published = (string) $this->element['published'];
$language = (string) $this->element['language'];
// Load the category options for a given extension.
if (!empty($extension))
{
// Filter over published state or not depending upon if it is present.
$filters = array();
if ($published)
{
$filters['filter.published'] = explode(',',
$published);
}
// Filter over language depending upon if it is present.
if ($language)
{
$filters['filter.language'] = explode(',',
$language);
}
if ($filters === array())
{
$options = JHtml::_('category.options', $extension);
}
else
{
$options = JHtml::_('category.options', $extension,
$filters);
}
// Verify permissions. If the action attribute is set, then we scan the
options.
if ((string) $this->element['action'])
{
// Get the current user object.
$user = JFactory::getUser();
foreach ($options as $i => $option)
{
/*
* To take save or create in a category you need to have create rights
for that category
* unless the item is already in that category.
* Unset the option if the user isn't authorised for it. In this
field assets are always categories.
*/
if ($user->authorise('core.create', $extension .
'.category.' . $option->value) === false)
{
unset($options[$i]);
}
}
}
if (isset($this->element['show_root']))
{
array_unshift($options, JHtml::_('select.option',
'0', JText::_('JGLOBAL_ROOT')));
}
}
else
{
JLog::add(JText::_('JLIB_FORM_ERROR_FIELDS_CATEGORY_ERROR_EXTENSION_EMPTY'),
JLog::WARNING, 'jerror');
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
}
PK0\�[C[��componentlayout.phpnu�[���<?php
/**
* @package Joomla.Legacy
* @subpackage Form
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
jimport('joomla.filesystem.folder');
/**
* Form Field to display a list of the layouts for a component view from
* the extension or template overrides.
*
* @since 1.6
*/
class JFormFieldComponentlayout extends JFormField
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
protected $type = 'ComponentLayout';
/**
* Method to get the field input for a component layout field.
*
* @return string The field input.
*
* @since 1.6
*/
protected function getInput()
{
// Get the client id.
$clientId = $this->element['client_id'];
if ($clientId === null && $this->form instanceof JForm)
{
$clientId = $this->form->getValue('client_id');
}
$clientId = (int) $clientId;
$client = JApplicationHelper::getClientInfo($clientId);
// Get the extension.
$extension = (string) $this->element['extension'];
if (empty($extension) && ($this->form instanceof JForm))
{
$extension = $this->form->getValue('extension');
}
$extension = preg_replace('#\W#', '', $extension);
$template = (string) $this->element['template'];
$template = preg_replace('#\W#', '', $template);
$template_style_id = '';
if ($this->form instanceof JForm)
{
$template_style_id =
$this->form->getValue('template_style_id');
$template_style_id = preg_replace('#\W#', '',
$template_style_id);
}
$view = (string) $this->element['view'];
$view = preg_replace('#\W#', '', $view);
// If a template, extension and view are present build the options.
if ($extension && $view && $client)
{
// Load language file
$lang = JFactory::getLanguage();
$lang->load($extension . '.sys', JPATH_ADMINISTRATOR, null,
false, true)
|| $lang->load($extension . '.sys', JPATH_ADMINISTRATOR .
'/components/' . $extension, null, false, true);
// Get the database object and a new query object.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
// Build the query.
$query->select('e.element, e.name')
->from('#__extensions as e')
->where('e.client_id = ' . (int) $clientId)
->where('e.type = ' . $db->quote('template'))
->where('e.enabled = 1');
if ($template)
{
$query->where('e.element = ' . $db->quote($template));
}
if ($template_style_id)
{
$query->join('LEFT', '#__template_styles as s on
s.template=e.element')
->where('s.id=' . (int) $template_style_id);
}
// Set the query and load the templates.
$db->setQuery($query);
$templates = $db->loadObjectList('element');
// Build the search paths for component layouts.
$component_path = JPath::clean($client->path .
'/components/' . $extension . '/views/' . $view .
'/tmpl');
// Prepare array of component layouts
$component_layouts = array();
// Prepare the grouped list
$groups = array();
// Add a Use Global option if useglobal="true" in XML file
if ((string) $this->element['useglobal'] ===
'true')
{
$groups[JText::_('JOPTION_FROM_STANDARD')]['items'][]
= JHtml::_('select.option', '',
JText::_('JGLOBAL_USE_GLOBAL'));
}
// Add the layout options from the component path.
if (is_dir($component_path) && ($component_layouts =
JFolder::files($component_path, '^[^_]*\.xml$', false, true)))
{
// Create the group for the component
$groups['_'] = array();
$groups['_']['id'] = $this->id . '__';
$groups['_']['text'] =
JText::sprintf('JOPTION_FROM_COMPONENT');
$groups['_']['items'] = array();
foreach ($component_layouts as $i => $file)
{
// Attempt to load the XML file.
if (!$xml = simplexml_load_file($file))
{
unset($component_layouts[$i]);
continue;
}
// Get the help data from the XML file if present.
if (!$menu = $xml->xpath('layout[1]'))
{
unset($component_layouts[$i]);
continue;
}
$menu = $menu[0];
// Add an option to the component group
$value = basename($file, '.xml');
$component_layouts[$i] = $value;
$text = isset($menu['option']) ?
JText::_($menu['option']) : (isset($menu['title']) ?
JText::_($menu['title']) : $value);
$groups['_']['items'][] =
JHtml::_('select.option', '_:' . $value, $text);
}
}
// Loop on all templates
if ($templates)
{
foreach ($templates as $template)
{
// Load language file
$lang->load('tpl_' . $template->element .
'.sys', $client->path, null, false, true)
|| $lang->load('tpl_' . $template->element .
'.sys', $client->path . '/templates/' .
$template->element, null, false, true);
$template_path = JPath::clean(
$client->path
. '/templates/'
. $template->element
. '/html/'
. $extension
. '/'
. $view
);
// Add the layout options from the template path.
if (is_dir($template_path) && ($files =
JFolder::files($template_path, '^[^_]*\.php$', false, true)))
{
foreach ($files as $i => $file)
{
// Remove layout files that exist in the component folder
if (in_array(basename($file, '.php'), $component_layouts))
{
unset($files[$i]);
}
}
if (count($files))
{
// Create the group for the template
$groups[$template->name] = array();
$groups[$template->name]['id'] = $this->id .
'_' . $template->element;
$groups[$template->name]['text'] =
JText::sprintf('JOPTION_FROM_TEMPLATE', $template->name);
$groups[$template->name]['items'] = array();
foreach ($files as $file)
{
// Add an option to the template group
$value = basename($file, '.php');
$text = $lang
->hasKey(
$key = strtoupper(
'TPL_'
. $template->name
. '_'
. $extension
. '_'
. $view
. '_LAYOUT_'
. $value
)
)
? JText::_($key) : $value;
$groups[$template->name]['items'][] =
JHtml::_('select.option', $template->element . ':' .
$value, $text);
}
}
}
}
}
// Compute attributes for the grouped list
$attr = $this->element['size'] ? ' size="' .
(int) $this->element['size'] . '"' :
'';
$attr .= $this->element['class'] ? '
class="' . (string) $this->element['class'] .
'"' : '';
// Prepare HTML code
$html = array();
// Compute the current selected values
$selected = array($this->value);
// Add a grouped list
$html[] = JHtml::_(
'select.groupedlist', $groups, $this->name,
array('id' => $this->id, 'group.id' =>
'id', 'list.attr' => $attr, 'list.select'
=> $selected)
);
return implode($html);
}
else
{
return '';
}
}
}
PK0\�[�c����modulelayout.phpnu�[���<?php
/**
* @package Joomla.Legacy
* @subpackage Form
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
jimport('joomla.filesystem.folder');
/**
* Form Field to display a list of the layouts for module display from the
module or template overrides.
*
* @since 1.6
*/
class JFormFieldModulelayout extends JFormField
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
protected $type = 'ModuleLayout';
/**
* Method to get the field input for module layouts.
*
* @return string The field input.
*
* @since 1.6
*/
protected function getInput()
{
// Get the client id.
$clientId = $this->element['client_id'];
if ($clientId === null && $this->form instanceof JForm)
{
$clientId = $this->form->getValue('client_id');
}
$clientId = (int) $clientId;
$client = JApplicationHelper::getClientInfo($clientId);
// Get the module.
$module = (string) $this->element['module'];
if (empty($module) && ($this->form instanceof JForm))
{
$module = $this->form->getValue('module');
}
$module = preg_replace('#\W#', '', $module);
// Get the template.
$template = (string) $this->element['template'];
$template = preg_replace('#\W#', '', $template);
// Get the style.
$template_style_id = '';
if ($this->form instanceof JForm)
{
$template_style_id =
$this->form->getValue('template_style_id');
$template_style_id = preg_replace('#\W#', '',
$template_style_id);
}
// If an extension and view are present build the options.
if ($module && $client)
{
// Load language file
$lang = JFactory::getLanguage();
$lang->load($module . '.sys', $client->path, null,
false, true)
|| $lang->load($module . '.sys', $client->path .
'/modules/' . $module, null, false, true);
// Get the database object and a new query object.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
// Build the query.
$query->select('element, name')
->from('#__extensions as e')
->where('e.client_id = ' . (int) $clientId)
->where('e.type = ' . $db->quote('template'))
->where('e.enabled = 1');
if ($template)
{
$query->where('e.element = ' . $db->quote($template));
}
if ($template_style_id)
{
$query->join('LEFT', '#__template_styles as s on
s.template=e.element')
->where('s.id=' . (int) $template_style_id);
}
// Set the query and load the templates.
$db->setQuery($query);
$templates = $db->loadObjectList('element');
// Build the search paths for module layouts.
$module_path = JPath::clean($client->path . '/modules/' .
$module . '/tmpl');
// Prepare array of component layouts
$module_layouts = array();
// Prepare the grouped list
$groups = array();
// Add the layout options from the module path.
if (is_dir($module_path) && ($module_layouts =
JFolder::files($module_path, '^[^_]*\.php$')))
{
// Create the group for the module
$groups['_'] = array();
$groups['_']['id'] = $this->id . '__';
$groups['_']['text'] =
JText::sprintf('JOPTION_FROM_MODULE');
$groups['_']['items'] = array();
foreach ($module_layouts as $file)
{
// Add an option to the module group
$value = basename($file, '.php');
$text = $lang->hasKey($key = strtoupper($module .
'_LAYOUT_' . $value)) ? JText::_($key) : $value;
$groups['_']['items'][] =
JHtml::_('select.option', '_:' . $value, $text);
}
}
// Loop on all templates
if ($templates)
{
foreach ($templates as $template)
{
// Load language file
$lang->load('tpl_' . $template->element .
'.sys', $client->path, null, false, true)
|| $lang->load('tpl_' . $template->element .
'.sys', $client->path . '/templates/' .
$template->element, null, false, true);
$template_path = JPath::clean($client->path .
'/templates/' . $template->element . '/html/' .
$module);
// Add the layout options from the template path.
if (is_dir($template_path) && ($files =
JFolder::files($template_path, '^[^_]*\.php$')))
{
foreach ($files as $i => $file)
{
// Remove layout that already exist in component ones
if (in_array($file, $module_layouts))
{
unset($files[$i]);
}
}
if (count($files))
{
// Create the group for the template
$groups[$template->element] = array();
$groups[$template->element]['id'] = $this->id .
'_' . $template->element;
$groups[$template->element]['text'] =
JText::sprintf('JOPTION_FROM_TEMPLATE', $template->name);
$groups[$template->element]['items'] = array();
foreach ($files as $file)
{
// Add an option to the template group
$value = basename($file, '.php');
$text = $lang->hasKey($key = strtoupper('TPL_' .
$template->element . '_' . $module . '_LAYOUT_' .
$value))
? JText::_($key) : $value;
$groups[$template->element]['items'][] =
JHtml::_('select.option', $template->element . ':' .
$value, $text);
}
}
}
}
}
// Compute attributes for the grouped list
$attr = $this->element['size'] ? ' size="' .
(int) $this->element['size'] . '"' :
'';
$attr .= $this->element['class'] ? '
class="' . (string) $this->element['class'] .
'"' : '';
// Prepare HTML code
$html = array();
// Compute the current selected values
$selected = array($this->value);
// Add a grouped list
$html[] = JHtml::_(
'select.groupedlist', $groups, $this->name,
array('id' => $this->id, 'group.id' =>
'id', 'list.attr' => $attr, 'list.select'
=> $selected)
);
return implode($html);
}
else
{
return '';
}
}
}
PKh{�[����� terms.phpnu�[���<?php
/**
* @package Joomla.Plugin
* @subpackage User.terms
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Language\Associations;
use Joomla\CMS\Language\Text;
FormHelper::loadFieldClass('radio');
/**
* Provides input for privacyterms
*
* @since 3.9.0
*/
class JFormFieldterms extends JFormFieldRadio
{
/**
* The form field type.
*
* @var string
* @since 3.9.0
*/
protected $type = 'terms';
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 3.9.0
*/
protected function getInput()
{
// Display the message before the field
echo
$this->getRenderer('plugins.user.terms.message')->render($this->getLayoutData());
return parent::getInput();
}
/**
* Method to get the field label markup.
*
* @return string The field label markup.
*
* @since 3.9.0
*/
protected function getLabel()
{
if ($this->hidden)
{
return '';
}
return
$this->getRenderer('plugins.user.terms.label')->render($this->getLayoutData());
}
/**
* Method to get the data to be passed to the layout for rendering.
*
* @return array
*
* @since 3.9.4
*/
protected function getLayoutData()
{
$data = parent::getLayoutData();
$article = false;
$termsArticle = $this->element['article'] > 0 ? (int)
$this->element['article'] : 0;
if ($termsArticle &&
Factory::getApplication()->isClient('site'))
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName(array('id', 'alias',
'catid', 'language')))
->from($db->quoteName('#__content'))
->where($db->quoteName('id') . ' = ' . (int)
$termsArticle);
$db->setQuery($query);
$article = $db->loadObject();
JLoader::register('ContentHelperRoute', JPATH_BASE .
'/components/com_content/helpers/route.php');
if (Associations::isEnabled())
{
$termsAssociated =
Associations::getAssociations('com_content',
'#__content', 'com_content.item', $termsArticle);
}
$currentLang = Factory::getLanguage()->getTag();
if (isset($termsAssociated) && $currentLang !==
$article->language && array_key_exists($currentLang,
$termsAssociated))
{
$article->link = ContentHelperRoute::getArticleRoute(
$termsAssociated[$currentLang]->id,
$termsAssociated[$currentLang]->catid,
$termsAssociated[$currentLang]->language
);
}
else
{
$slug = $article->alias ? ($article->id . ':' .
$article->alias) : $article->id;
$article->link = ContentHelperRoute::getArticleRoute($slug,
$article->catid, $article->language);
}
}
$extraData = array(
'termsnote' => !empty($this->element['note'])
? $this->element['note'] :
Text::_('PLG_USER_TERMS_NOTE_FIELD_DEFAULT'),
'options' => $this->getOptions(),
'value' => (string) $this->value,
'translateLabel' => $this->translateLabel,
'translateDescription' => $this->translateDescription,
'translateHint' => $this->translateHint,
'termsArticle' => $termsArticle,
'article' => $article,
);
return array_merge($data, $extraData);
}
}
PK�"�[=�ؙ��data.phpnu�[���<?php
/**
* @package Joomla.Plugin
* @subpackage System.stats
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('PlgSystemStatsFormFieldBase', __DIR__ .
'/base.php');
/**
* Unique ID Field class for the Stats Plugin.
*
* @since 3.5
*/
class PlgSystemStatsFormFieldData extends PlgSystemStatsFormFieldBase
{
/**
* The form field type.
*
* @var string
* @since 3.5
*/
protected $type = 'Data';
/**
* Name of the layout being used to render the field
*
* @var string
* @since 3.5
*/
protected $layout = 'field.data';
/**
* Method to get the data to be passed to the layout for rendering.
*
* @return array
*
* @since 3.5
*/
protected function getLayoutData()
{
$data = parent::getLayoutData();
$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('system', 'stats');
$result = $dispatcher->trigger('onGetStatsData',
array('stats.field.data'));
$data['statsData'] = $result ? reset($result) : array();
return $data;
}
}
PK�"�[G���uniqueid.phpnu�[���<?php
/**
* @package Joomla.Plugin
* @subpackage System.stats
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('PlgSystemStatsFormFieldBase', __DIR__ .
'/base.php');
/**
* Unique ID Field class for the Stats Plugin.
*
* @since 3.5
*/
class PlgSystemStatsFormFieldUniqueid extends PlgSystemStatsFormFieldBase
{
/**
* The form field type.
*
* @var string
* @since 3.5
*/
protected $type = 'Uniqueid';
/**
* Name of the layout being used to render the field
*
* @var string
* @since 3.5
*/
protected $layout = 'field.uniqueid';
}
PK+,�[�6�I��base.phpnu�[���<?php
/**
* @package Joomla.Plugin
* @subpackage System.stats
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Base field for the Stats Plugin.
*
* @since 3.5
*/
abstract class PlgSystemStatsFormFieldBase extends JFormField
{
/**
* Get the layouts paths
*
* @return array
*
* @since 3.5
*/
protected function getLayoutPaths()
{
$template = JFactory::getApplication()->getTemplate();
return array(
JPATH_ADMINISTRATOR . '/templates/' . $template .
'/html/layouts/plugins/system/stats',
dirname(__DIR__) . '/layouts',
JPATH_SITE . '/layouts'
);
}
}
PK�0�[�
�U�� skins.phpnu�[���<?php
/**
* @package Joomla.Plugin
* @subpackage Editors.tinymce
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Generates the list of options for available skins.
*
* @package Joomla.Plugin
* @subpackage Editors.tinymce
* @since 3.4
*/
class JFormFieldSkins extends JFormFieldList
{
protected $type = 'skins';
/**
* Method to get the skins options.
*
* @return array The skins option objects.
*
* @since 3.4
*/
public function getOptions()
{
$options = array();
$directories = glob(JPATH_ROOT . '/media/editors/tinymce/skins'
. '/*', GLOB_ONLYDIR);
for ($i = 0, $iMax = count($directories); $i < $iMax; ++$i)
{
$dir = basename($directories[$i]);
$options[] = JHtml::_('select.option', $i, $dir);
}
$options = array_merge(parent::getOptions(), $options);
return $options;
}
/**
* Method to get the field input markup for the list of skins.
*
* @return string The field input markup.
*
* @since 3.4
*/
protected function getInput()
{
$html = array();
// Get the field options.
$options = (array) $this->getOptions();
// Create a regular list.
$html[] = JHtml::_('select.genericlist', $options,
$this->name, '', 'value', 'text',
$this->value, $this->id);
return implode($html);
}
}
PK�0�[�i��::tinymcebuilder.phpnu�[���<?php
/**
* @package Joomla.Plugin
* @subpackage Editors.tinymce
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Form Field class for the TinyMCE editor.
*
* @package Joomla.Plugin
* @subpackage Editors.tinymce
* @since 3.7.0
*/
class JFormFieldTinymceBuilder extends JFormField
{
/**
* The form field type.
*
* @var string
* @since 3.7.0
*/
protected $type = 'tinymcebuilder';
/**
* Name of the layout being used to render the field
*
* @var string
* @since 3.7.0
*/
protected $layout =
'plugins.editors.tinymce.field.tinymcebuilder';
/**
* The prepared layout data
*
* @var array
* @since 3.7.0
*/
protected $layoutData = array();
/**
* Method to get the data to be passed to the layout for rendering.
*
* @return array
*
* @since 3.7.0
*/
protected function getLayoutData()
{
if (!empty($this->layoutData))
{
return $this->layoutData;
}
$data = parent::getLayoutData();
$paramsAll = (object) $this->form->getValue('params');
$setsAmount = empty($paramsAll->sets_amount) ? 3 :
$paramsAll->sets_amount;
if (empty($data['value']))
{
$data['value'] = array();
}
// Get the plugin
require_once JPATH_PLUGINS . '/editors/tinymce/tinymce.php';
$menus = array(
'edit' => array('label' =>
'Edit'),
'insert' => array('label' =>
'Insert'),
'view' => array('label' =>
'View'),
'format' => array('label' =>
'Format'),
'table' => array('label' =>
'Table'),
'tools' => array('label' =>
'Tools'),
);
$data['menus'] = $menus;
$data['menubarSource'] = array_keys($menus);
$data['buttons'] = PlgEditorTinymce::getKnownButtons();
$data['buttonsSource'] =
array_keys($data['buttons']);
$data['toolbarPreset'] = PlgEditorTinymce::getToolbarPreset();
$data['setsAmount'] = $setsAmount;
// Get array of sets names
for ($i = 0; $i < $setsAmount; $i++)
{
$data['setsNames'][$i] =
JText::sprintf('PLG_TINY_SET_TITLE', $i);
}
// Prepare the forms for each set
$setsForms = array();
$formsource = JPATH_PLUGINS .
'/editors/tinymce/form/setoptions.xml';
// Preload an old params for B/C
$setParams = new stdClass;
if (!empty($paramsAll->html_width) &&
empty($paramsAll->configuration['setoptions']))
{
$plugin = JPluginHelper::getPlugin('editors',
'tinymce');
JFactory::getApplication()->enqueueMessage(JText::sprintf('PLG_TINY_LEGACY_WARNING',
'#'), 'warning');
if (is_object($plugin) && !empty($plugin->params))
{
$setParams = (object) json_decode($plugin->params);
}
}
// Collect already used groups
$groupsInUse = array();
// Prepare the Set forms, for the set options
foreach (array_keys($data['setsNames']) as $num)
{
$formname = 'set.form.' . $num;
$control = $this->name . '[setoptions][' . $num .
']';
$setsForms[$num] = JForm::getInstance($formname, $formsource,
array('control' => $control));
// Check whether we already have saved values or it first time or even
old params
if (empty($this->value['setoptions'][$num]))
{
$formValues = $setParams;
/*
* Predefine group:
* Set 0: for Administrator, Editor, Super Users (4,7,8)
* Set 1: for Registered, Manager (2,6), all else are public
*/
$formValues->access = !$num ? array(4,7,8) : ($num === 1 ?
array(2,6) : array());
// Assign Public to the new Set, but only when it not in use already
if (empty($formValues->access) && !in_array(1,
$groupsInUse))
{
$formValues->access = array(1);
}
}
else
{
$formValues = (object) $this->value['setoptions'][$num];
}
// Collect already used groups
if (!empty($formValues->access))
{
$groupsInUse = array_merge($groupsInUse, $formValues->access);
}
// Bind the values
$setsForms[$num]->bind($formValues);
}
krsort($data['setsNames']);
$data['setsForms'] = $setsForms;
// Check for TinyMCE language file
$language = JFactory::getLanguage();
$languageFile1 = 'media/editors/tinymce/langs/' .
$language->getTag() . '.js';
$languageFile2 = 'media/editors/tinymce/langs/' .
substr($language->getTag(), 0, strpos($language->getTag(),
'-')) . '.js';
$data['languageFile'] = '';
if (file_exists(JPATH_ROOT . '/' . $languageFile1))
{
$data['languageFile'] = $languageFile1;
}
elseif (file_exists(JPATH_ROOT . '/' . $languageFile2))
{
$data['languageFile'] = $languageFile2;
}
$this->layoutData = $data;
return $data;
}
}
PK�0�[���iu u uploaddirs.phpnu�[���<?php
/**
* @package Joomla.Plugin
* @subpackage Editors.tinymce
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('folderlist');
/**
* Generates the list of directories available for drag and drop upload.
*
* @package Joomla.Plugin
* @subpackage Editors.tinymce
* @since 3.7.0
*/
class JFormFieldUploaddirs extends JFormFieldFolderList
{
protected $type = 'uploaddirs';
/**
* Method to attach a JForm object to the field.
*
* @param SimpleXMLElement $element The SimpleXMLElement object
representing the `<field>` tag for the form field object.
* @param mixed $value The form field value to validate.
* @param string $group The field name group control
value. This acts as an array container for the field.
* For example if the field has
name="foo" and the group value is set to "bar" then the
* full field name would end up being
"bar[foo]".
*
* @return boolean True on success.
*
* @see JFormField::setup()
* @since 3.7.0
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$return = parent::setup($element, $value, $group);
// Get the path in which to search for file options.
$this->directory =
JComponentHelper::getParams('com_media')->get('image_path');
$this->recursive = true;
$this->hideDefault = true;
return $return;
}
/**
* Method to get the directories options.
*
* @return array The dirs option objects.
*
* @since 3.7.0
*/
public function getOptions()
{
return parent::getOptions();
}
/**
* Method to get the field input markup for the list of directories.
*
* @return string The field input markup.
*
* @since 3.7.0
*/
protected function getInput()
{
$html = array();
// Get the field options.
$options = (array) $this->getOptions();
// Reset the non selected value to null
if ($options[0]->value === '-1')
{
$options[0]->value = '';
}
// Create a regular list.
$html[] = JHtml::_('select.genericlist', $options,
$this->name, '', 'value', 'text',
$this->value, $this->id);
return implode($html);
}
}
PK5�[觉T��dob.phpnu�[���<?php
/**
* @package Joomla.Plugin
* @subpackage User.profile
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
JFormHelper::loadFieldClass('calendar');
/**
* Provides input for "Date of Birth" field
*
* @package Joomla.Plugin
* @subpackage User.profile
* @since 3.3.7
*/
class JFormFieldDob extends JFormFieldCalendar
{
/**
* The form field type.
*
* @var string
* @since 3.3.7
*/
protected $type = 'Dob';
/**
* Method to get the field label markup.
*
* @return string The field label markup.
*
* @since 3.3.7
*/
protected function getLabel()
{
$label = parent::getLabel();
// Get the info text from the XML element, defaulting to empty.
$text = $this->element['info'] ? (string)
$this->element['info'] : '';
$text = $this->translateLabel ? JText::_($text) : $text;
if ($text)
{
$app = JFactory::getApplication();
$layout = new JLayoutFile('plugins.user.profile.fields.dob');
$view = $app->input->getString('view', '');
// Only display the tip when editing profile
if ($view === 'registration' || $view === 'profile'
|| $app->isClient('administrator'))
{
$layout = new JLayoutFile('plugins.user.profile.fields.dob');
$info = $layout->render(array('text' => $text));
$label = $info . $label;
}
}
return $label;
}
}
PK5�[��%""tos.phpnu�[���<?php
/**
* @package Joomla.Plugin
* @subpackage User.profile
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
JFormHelper::loadFieldClass('radio');
/**
* Provides input for TOS
*
* @since 2.5.5
*/
class JFormFieldTos extends JFormFieldRadio
{
/**
* The form field type.
*
* @var string
* @since 2.5.5
*/
protected $type = 'Tos';
/**
* Method to get the field label markup.
*
* @return string The field label markup.
*
* @since 2.5.5
*/
protected function getLabel()
{
$label = '';
if ($this->hidden)
{
return $label;
}
// Get the label text from the XML element, defaulting to the element
name.
$text = $this->element['label'] ? (string)
$this->element['label'] : (string)
$this->element['name'];
$text = $this->translateLabel ? JText::_($text) : $text;
// Set required to true as this field is not displayed at all if not
required.
$this->required = true;
// Build the class for the label.
$class = !empty($this->description) ? 'hasPopover' :
'';
$class = $class . ' required';
$class = !empty($this->labelClass) ? $class . ' ' .
$this->labelClass : $class;
// Add the opening label tag and main attributes attributes.
$label .= '<label id="' . $this->id .
'-lbl" for="' . $this->id . '"
class="' . $class . '"';
// If a description is specified, use it to build a tooltip.
if (!empty($this->description))
{
$label .= ' title="' . htmlspecialchars(trim($text,
':'), ENT_COMPAT, 'UTF-8') . '"';
$label .= ' data-content="' . htmlspecialchars(
$this->translateDescription ? JText::_($this->description) :
$this->description,
ENT_COMPAT,
'UTF-8'
) . '"';
if (JFactory::getLanguage()->isRtl())
{
$label .= ' data-placement="left"';
}
}
$tosArticle = $this->element['article'] > 0 ? (int)
$this->element['article'] : 0;
if ($tosArticle)
{
JHtml::_('behavior.modal');
JLoader::register('ContentHelperRoute', JPATH_BASE .
'/components/com_content/helpers/route.php');
$attribs = array();
$attribs['class'] = 'modal';
$attribs['rel'] = '{handler: \'iframe\',
size: {x:800, y:500}}';
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('id, alias, catid, language')
->from('#__content')
->where('id = ' . $tosArticle);
$db->setQuery($query);
$article = $db->loadObject();
if (JLanguageAssociations::isEnabled())
{
$tosAssociated =
JLanguageAssociations::getAssociations('com_content',
'#__content', 'com_content.item', $tosArticle);
}
$currentLang = JFactory::getLanguage()->getTag();
if (isset($tosAssociated) && $currentLang !==
$article->language && array_key_exists($currentLang,
$tosAssociated))
{
$url = ContentHelperRoute::getArticleRoute(
$tosAssociated[$currentLang]->id,
$tosAssociated[$currentLang]->catid,
$tosAssociated[$currentLang]->language
);
$link = JHtml::_('link', JRoute::_($url .
'&tmpl=component'), $text, $attribs);
}
else
{
$slug = $article->alias ? ($article->id . ':' .
$article->alias) : $article->id;
$url = ContentHelperRoute::getArticleRoute($slug, $article->catid,
$article->language);
$link = JHtml::_('link', JRoute::_($url .
'&tmpl=component'), $text, $attribs);
}
}
else
{
$link = $text;
}
// Add the label text and closing tag.
$label .= '>' . $link . '<span
class="star"> *</span></label>';
return $label;
}
}
PKD�[T�x�
�
privacy.phpnu�[���<?php
/**
* @package Joomla.Plugin
* @subpackage System.privacyconsent
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
JFormHelper::loadFieldClass('radio');
/**
* Provides input for privacy
*
* @since 3.9.0
*/
class JFormFieldprivacy extends JFormFieldRadio
{
/**
* The form field type.
*
* @var string
* @since 3.9.0
*/
protected $type = 'privacy';
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 3.9.0
*/
protected function getInput()
{
// Display the message before the field
echo
$this->getRenderer('plugins.system.privacyconsent.message')->render($this->getLayoutData());
return parent::getInput();
}
/**
* Method to get the field label markup.
*
* @return string The field label markup.
*
* @since 3.9.0
*/
protected function getLabel()
{
if ($this->hidden)
{
return '';
}
return
$this->getRenderer('plugins.system.privacyconsent.label')->render($this->getLayoutData());
}
/**
* Method to get the data to be passed to the layout for rendering.
*
* @return array
*
* @since 3.9.4
*/
protected function getLayoutData()
{
$data = parent::getLayoutData();
$article = false;
$privacyArticle = $this->element['article'] > 0 ? (int)
$this->element['article'] : 0;
if ($privacyArticle &&
Factory::getApplication()->isClient('site'))
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName(array('id', 'alias',
'catid', 'language')))
->from($db->quoteName('#__content'))
->where($db->quoteName('id') . ' = ' . (int)
$privacyArticle);
$db->setQuery($query);
$article = $db->loadObject();
JLoader::register('ContentHelperRoute', JPATH_BASE .
'/components/com_content/helpers/route.php');
$slug = $article->alias ? ($article->id . ':' .
$article->alias) : $article->id;
$article->link = ContentHelperRoute::getArticleRoute($slug,
$article->catid, $article->language);
}
$extraData = array(
'privacynote' =>
!empty($this->element['note']) ?
$this->element['note'] :
Text::_('PLG_SYSTEM_PRIVACYCONSENT_NOTE_FIELD_DEFAULT'),
'options' => $this->getOptions(),
'value' => (string) $this->value,
'translateLabel' => $this->translateLabel,
'translateDescription' => $this->translateDescription,
'translateHint' => $this->translateHint,
'privacyArticle' => $privacyArticle,
'article' => $article,
);
return array_merge($data, $extraData);
}
}
PK.�[5�r���accesslevel.phpnu�[���PK.�[\�����actions.phpnu�[���PK.�[[���vv
�&button.phpnu�[���PK.�[�d�^� � d3cachehandler.phpnu�[���PK.�[y�I���`=calendar.phpnu�[���PK.�[4�H���Rcaptcha.phpnu�[���PK.�[ͮ�x���Zcheckbox.phpnu�[���PK.�[tyR�
�
qicheckboxes.phpnu�[���PK/�[��&)���tcomponents.phpnu�[���PK/�['b�
��editor.phpnu�[���PK/�[i�ee �email.phpnu�[���PK/�[V����~�groupedbutton.phpnu�[���PK/�[́��**��groupedlist.phpnu�[���PK/�[�Ll
��
�hidden.phpnu�[���PK/�[N�'""
�image.phpnu�[���PK/�[`��
e�imagelist.phpnu�[���PK/�[ �ut� � ��integer.phpnu�[���PK/�[� ه<<T�language.phpnu�[���PK/�[t~�F'F'��list.phpnu�[���PK/�[�E�
YY Jmedia.phpnu�[���PK/�[7�Z� �"model.phpnu�[���PK/�[�RҎ��+=ordering.phpnu�[���PK/�[���ؐ � ;Tpassword.phpnu�[���PK/�[N�'� � ^plugins.phpnu�[���PK/�[>1f��
�gpublished.phpnu�[���PK/�[Ȋ�}� � ({radio.phpnu�[���PK/�[�q]�tt�relation.phpnu�[���PK/�[s�e�d�d ��rules.phpnu�[���PK/�[�l�:}}
��selectrow.phpnu�[���PK/�[�2�� � y sessionhandler.phpnu�[���PK/�[3����
~spacer.phpnu�[���PK/�[���� � �sql.phpnu�[���PK/�[i6R;���%tag.phpnu�[���PK/�[�#B\�
�
]9tel.phpnu�[���PK/�[ӧ@����Gtext.phpnu�[���PK/�[!9����KTtextarea.phpnu�[���PK/�[���
']timezone.phpnu�[���PK/�[�V�
vgtitle.phpnu�[���PK/�[xj���
�
�murl.phpnu�[���PK/�[(�oo�{user.phpnu�[���PK/�[j���
�
��usergroup.phpnu�[���PK|O�[�,]�����boolean.phpnu�[���PK|O�[ln�¨date.phpnu�[���PK|O�[��P�
��number.phpnu�[���PK0\�[C�HH��category.phpnu�[���PK0\�[C[��|�componentlayout.phpnu�[���PK0\�[�c�����modulelayout.phpnu�[���PKh{�[����� �terms.phpnu�[���PK�"�[=�ؙ���data.phpnu�[���PK�"�[G����
uniqueid.phpnu�[���PK+,�[�6�I��$base.phpnu�[���PK�0�[�
�U�� 1'skins.phpnu�[���PK�0�[�i��::W-tinymcebuilder.phpnu�[���PK�0�[���iu u �?uploaddirs.phpnu�[���PK5�[觉T���Idob.phpnu�[���PK5�[��%""�Otos.phpnu�[���PKD�[T�x�
�
�]privacy.phpnu�[���PK99��h