| Current Path : /home/w/u/e/wuectly/www/03cbe/ |
| Current File : /home/w/u/e/wuectly/www/03cbe/list.php.tar |
home/wuectly/www/libraries/cms/html/list.php 0000604 00000015271 15245530311 0015203 0 ustar 00 <?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
use Joomla\String\StringHelper;
/**
* Utility class for creating different select lists
*
* @since 1.5
*/
abstract class JHtmlList
{
/**
* Build the select list to choose an image
*
* @param string $name The name of the field
* @param string $active The selected item
* @param string $javascript Alternative javascript
* @param string $directory Directory the images are stored in
* @param string $extensions Allowed extensions
*
* @return array Image names
*
* @since 1.5
*/
public static function images($name, $active = null, $javascript = null, $directory = null, $extensions = 'bmp|gif|jpg|png')
{
if (!$directory)
{
$directory = '/images/';
}
if (!$javascript)
{
$javascript = "onchange=\"if (document.forms.adminForm." . $name
. ".options[selectedIndex].value!='') {document.imagelib.src='..$directory' + document.forms.adminForm." . $name
. ".options[selectedIndex].value} else {document.imagelib.src='media/system/images/blank.png'}\"";
}
$imageFiles = new DirectoryIterator(JPATH_SITE . '/' . $directory);
$images = array(JHtml::_('select.option', '', JText::_('JOPTION_SELECT_IMAGE')));
foreach ($imageFiles as $file)
{
$fileName = $file->getFilename();
if (!$file->isFile())
{
continue;
}
if (preg_match('#(' . $extensions . ')$#', $fileName))
{
$images[] = JHtml::_('select.option', $fileName);
}
}
$images = JHtml::_(
'select.genericlist',
$images,
$name,
array(
'list.attr' => 'class="inputbox" size="1" ' . $javascript,
'list.select' => $active,
)
);
return $images;
}
/**
* Returns an array of options
*
* @param string $query SQL with 'ordering' AS value and 'name field' AS text
* @param integer $chop The length of the truncated headline
*
* @return array An array of objects formatted for JHtml list processing
*
* @since 1.5
*/
public static function genericordering($query, $chop = 30)
{
$db = JFactory::getDbo();
$options = array();
$db->setQuery($query);
$items = $db->loadObjectList();
if (empty($items))
{
$options[] = JHtml::_('select.option', 1, JText::_('JOPTION_ORDER_FIRST'));
return $options;
}
$options[] = JHtml::_('select.option', 0, '0 ' . JText::_('JOPTION_ORDER_FIRST'));
for ($i = 0, $n = count($items); $i < $n; $i++)
{
$items[$i]->text = JText::_($items[$i]->text);
if (StringHelper::strlen($items[$i]->text) > $chop)
{
$text = StringHelper::substr($items[$i]->text, 0, $chop) . '...';
}
else
{
$text = $items[$i]->text;
}
$options[] = JHtml::_('select.option', $items[$i]->value, $items[$i]->value . '. ' . $text);
}
$options[] = JHtml::_('select.option', $items[$i - 1]->value + 1, ($items[$i - 1]->value + 1) . ' ' . JText::_('JOPTION_ORDER_LAST'));
return $options;
}
/**
* Build the select list for Ordering derived from a query
*
* @param integer $name The scalar value
* @param string $query The query
* @param string $attribs HTML tag attributes
* @param string $selected The selected item
* @param integer $neworder 1 if new and first, -1 if new and last, 0 or null if existing item
*
* @return string HTML markup for the select list
*
* @since 1.6
*/
public static function ordering($name, $query, $attribs = null, $selected = null, $neworder = null)
{
if (empty($attribs))
{
$attribs = 'class="inputbox" size="1"';
}
if (empty($neworder))
{
$orders = JHtml::_('list.genericordering', $query);
$html = JHtml::_('select.genericlist', $orders, $name, array('list.attr' => $attribs, 'list.select' => (int) $selected));
}
else
{
if ($neworder > 0)
{
$text = JText::_('JGLOBAL_NEWITEMSLAST_DESC');
}
elseif ($neworder <= 0)
{
$text = JText::_('JGLOBAL_NEWITEMSFIRST_DESC');
}
$html = '<input type="hidden" name="' . $name . '" value="' . (int) $selected . '" /><span class="readonly">' . $text . '</span>';
}
return $html;
}
/**
* Select list of active users
*
* @param string $name The name of the field
* @param string $active The active user
* @param integer $nouser If set include an option to select no user
* @param string $javascript Custom javascript
* @param string $order Specify a field to order by
*
* @return string The HTML for a list of users list of users
*
* @since 1.5
*/
public static function users($name, $active, $nouser = 0, $javascript = null, $order = 'name')
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('u.id AS value, u.name AS text')
->from('#__users AS u')
->join('LEFT', '#__user_usergroup_map AS m ON m.user_id = u.id')
->where('u.block = 0')
->order($order)
->group('u.id');
$db->setQuery($query);
if ($nouser)
{
$users[] = JHtml::_('select.option', '0', JText::_('JOPTION_NO_USER'));
$users = array_merge($users, $db->loadObjectList());
}
else
{
$users = $db->loadObjectList();
}
$users = JHtml::_(
'select.genericlist',
$users,
$name,
array(
'list.attr' => 'class="inputbox" size="1" ' . $javascript,
'list.select' => $active,
)
);
return $users;
}
/**
* Select list of positions - generally used for location of images
*
* @param string $name Name of the field
* @param string $active The active value
* @param string $javascript Alternative javascript
* @param boolean $none Null if not assigned
* @param boolean $center Null if not assigned
* @param boolean $left Null if not assigned
* @param boolean $right Null if not assigned
* @param boolean $id Null if not assigned
*
* @return array The positions
*
* @since 1.5
*/
public static function positions($name, $active = null, $javascript = null, $none = true, $center = true, $left = true, $right = true,
$id = false)
{
$pos = array();
if ($none)
{
$pos[''] = JText::_('JNONE');
}
if ($center)
{
$pos['center'] = JText::_('JGLOBAL_CENTER');
}
if ($left)
{
$pos['left'] = JText::_('JGLOBAL_LEFT');
}
if ($right)
{
$pos['right'] = JText::_('JGLOBAL_RIGHT');
}
$positions = JHtml::_(
'select.genericlist', $pos, $name,
array(
'id' => $id,
'list.attr' => 'class="inputbox" size="1"' . $javascript,
'list.select' => $active,
'option.key' => null,
)
);
return $positions;
}
}
home/wuectly/www/plugins/fields/list/list.php 0000604 00000002040 15245611162 0015375 0 ustar 00 <?php
/**
* @package Joomla.Plugin
* @subpackage Fields.List
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::import('components.com_fields.libraries.fieldslistplugin', JPATH_ADMINISTRATOR);
/**
* Fields list Plugin
*
* @since 3.7.0
*/
class PlgFieldsList extends FieldsListPlugin
{
/**
* Prepares the field
*
* @param string $context The context.
* @param stdclass $item The item.
* @param stdclass $field The field.
*
* @return object
*
* @since 3.9.2
*/
public function onCustomFieldsPrepareField($context, $item, $field)
{
// Check if the field should be processed
if (!$this->isTypeSupported($field->type))
{
return;
}
// The field's rawvalue should be an array
if (!is_array($field->rawvalue))
{
$field->rawvalue = (array) $field->rawvalue;
}
return parent::onCustomFieldsPrepareField($context, $item, $field);
}
}
home/wuectly/www/plugins/fields/list/tmpl/list.php 0000604 00000001130 15245613243 0016352 0 ustar 00 <?php
/**
* @package Joomla.Plugin
* @subpackage Fields.List
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$fieldValue = $field->value;
if ($fieldValue == '')
{
return;
}
$fieldValue = (array) $fieldValue;
$texts = array();
$options = $this->getOptionsFromField($field);
foreach ($options as $value => $name)
{
if (in_array((string) $value, $fieldValue))
{
$texts[] = JText::_($name);
}
}
echo htmlentities(implode(', ', $texts));
home/wuectly/www/components/com_jce/editor/plugins/style/tmpl/list.php 0000604 00000002233 15245626653 0022361 0 ustar 00 <?php
/**
* @package JCE
* @subpackage Editor
*
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
?>
<div class="uk-form-row uk-grid uk-grid-small">
<label class="uk-form-label uk-width-2-10" for="list_type"><?php echo Text::_('WF_STYLES_LIST_TYPE'); ?></label>
<div class="uk-form-controls uk-width-4-10">
<select id="list_type" name="list_type"></select>
</div>
</div>
<div class="uk-form-row uk-grid uk-grid-small">
<label class="uk-form-label uk-width-2-10" for="list_position"><?php echo Text::_('WF_STYLES_POSITION'); ?></label>
<div class="uk-form-controls uk-width-4-10">
<select id="list_position" name="list_position"></select>
</div>
</div>
<div class="uk-form-row uk-grid uk-grid-small">
<label class="uk-form-label uk-width-2-10" for="list_bullet_image"><?php echo Text::_('WF_STYLES_BULLET_IMAGE'); ?></label>
<div class="uk-form-controls uk-width-8-10">
<input id="list_bullet_image" name="list_bullet_image" type="text" class="browser image" />
</div>
</div>
home/wuectly/www/layouts/joomla/pagination/list.php 0000604 00000001275 15245630152 0016616 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$list = $displayData['list'];
?>
<ul>
<li class="pagination-start"><?php echo $list['start']['data']; ?></li>
<li class="pagination-prev"><?php echo $list['previous']['data']; ?></li>
<?php foreach ($list['pages'] as $page) : ?>
<?php echo '<li>' . $page['data'] . '</li>'; ?>
<?php endforeach; ?>
<li class="pagination-next"><?php echo $list['next']['data']; ?></li>
<li class="pagination-end"><?php echo $list['end']['data']; ?></li>
</ul>
home/wuectly/www/libraries/fof/form/field/list.php 0000604 00000023506 15245657553 0016277 0 ustar 00 <?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;
}
}
home/wuectly/www/components/com_icagenda/models/list.php 0000604 00000037054 15245657555 0017571 0 ustar 00 <?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2015 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.5.4 2015-04-10
* @since 1.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
jimport( 'joomla.filesystem.path' );
// Load file helpers
if (!class_exists('iCModelItem')) require(JPATH_COMPONENT . '/helpers/icmodel.php');
if (!class_exists('iCModeliChelper')) require(JPATH_COMPONENT . '/helpers/ichelper.php');
/**
* icagenda Model
*/
class icagendaModelList extends iCModelItem
{
/**
* Get Form - Registration
*
* @since 3.4.1
*/
public function getForm()
{
$form = JForm::getInstance('submit', JPATH_COMPONENT . '/models/forms/registration.xml');
if (empty($form))
{
return false;
}
return $form;
}
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @since 3.6
*/
protected function populateState()
{
// Initialise variables.
$app = JFactory::getApplication();
$context = $app->input->get('option') . '.' . $app->input->get('view');
// Load the filter state.
$search = $app->getUserStateFromRequest($context.'.filter.search', 'filter_search');
//Omit double (white-)spaces and set state
$this->setState('filter.search', preg_replace('/\s+/',' ', $search));
//Filter (dropdown) state
$state = $app->getUserStateFromRequest($context.'.filter.state', 'filter_state', '', 'string');
$this->setState('filter.state', $state);
//Filter (dropdown) company
$category = $app->getUserStateFromRequest($context.'.filter.category', 'filter_category', '', 'string');
$this->setState('filter.category', $category);
}
/**
* Get Params
*
* @since 1.0
*/
public function getData()
{
$this->startiCModel();
// Import params
$app = JFactory::getApplication();
$icpar = $app->getParams();
// Get Current Layout
$jlayout = $app->input->getCmd('layout', '');
// $layouts_array = array('event', 'registration', 'actions');
// $layout = in_array($jlayout, $layouts_array) ? $jlayout : '';
$user = JFactory::getUser();
$userid = $user->get('id');
// Get Registration Post Data // TO BE REMOVED WHEN NEW REGISTRATION VIEW
$regpost = JRequest::get('post');
// Process registration function to save data (icmodel.php) // TO BE REMOVED WHEN NEW REGISTRATION VIEW
if ($app->input->get('event'))
{
$this->registration($regpost);
}
// filters
$this->addFilter('state', 1);
$id = JRequest::getInt('id');
// if ( $jlayout
// && ( ! $id) || ( ! preg_match("/^[0-9]+$/", $id)))
// {
// JError::raiseError('404',JTEXT::_('JERROR_LAYOUT_PAGE_NOT_FOUND'));
// return false;
// }
$Itemid = JRequest::getInt('Itemid');
if ($id)
{
$this->addFilter('id', $id);
}
else
{
if(JRequest::getVar('key', '', 'post')) $this->addFilter('key', JRequest::getVar('key', '','post'));
if($icpar->get('mcatid')) $this->addFilter('e.catid', $icpar->get('mcatid'));
if($icpar->get('place')) $this->addFilter('e.place', $icpar->get('place'));
if($icpar->get('address')) $this->addFilter('e.address', $icpar->get('address'));
if($icpar->get('time')) $this->addFilter('next', $icpar->get('time'));
}
$this->addOption('Itemid', $icpar->get('itemid', $Itemid));
// Get Option Menu and Global for Type of Display for List of Events (all dates, or only next date, for each event)
$this->addOption('datesDisplay', $icpar->get('datesDisplay', 1));
$this->addOption('filterTime', $icpar->get('time', 1));
// Menu Options
$this->addOption('number', $icpar->get('number', 5));
// App Options
$this->addOption('orderby', $icpar->get('orderby', 2));
$this->addOption('mcatid', $icpar->get('mcatid', array('0')));
// $this->addOption('format', $icpar->get('format', 0));
// Global Options
$this->addOption('addthis', $icpar->get('addthis', ''));
$this->addOption('atevent', $icpar->get('atevent', 1));
$this->addOption('atfloat', $icpar->get('atfloat', ''));
$this->addOption('aticon', $icpar->get('aticon', ''));
$this->addOption('emailRequired', $icpar->get('emailRequired', 0));
$this->addOption('limit', $icpar->get('limit', 100));
$this->addOption('limitGlobal', $icpar->get('limitGlobal', 0));
$this->addOption('maxRlist', $icpar->get('maxRlist', ''));
$this->addOption('participantList', $icpar->get('participantList', ''));
$this->addOption('participantSlide', $icpar->get('participantSlide', ''));
$this->addOption('phoneRequired', $icpar->get('phoneRequired', 0));
$this->addOption('RegButtonText', $icpar->get('RegButtonText', ''));
$this->addOption('statutReg', $icpar->get('statutReg', ''));
$this->addOption('timeformat', $icpar->get('timeformat', 1));
$this->addOption('m_width', $icpar->get('m_width', '100%'));
$this->addOption('m_height', $icpar->get('m_height', '300px'));
// $this->addOption('date_format', $icpar->get('date_format', ''));
// $this->addOption('date_separator', $icpar->get('date_separator', ' '));
if($icpar->get('participantDisplay')) $this->addOption('participantDisplay', $icpar->get('participantDisplay'));
if($icpar->get('fullListColumns')) $this->addOption('fullListColumns', $icpar->get('fullListColumns'));
if($icpar->get('targetLink')) $this->addOption('targetLink', $icpar->get('targetLink'));
if($icpar->get('arrowtext')) $this->addOption('arrowtext', $icpar->get('arrowtext'));
if($icpar->get('accessReg')) $this->addOption('accessReg', $icpar->get('accessReg'));
if($icpar->get('limitRegEmail')) $this->addOption('limitRegEmail', $icpar->get('limitRegEmail'));
if($icpar->get('limitRegDate')) $this->addOption('limitRegDate', $icpar->get('limitRegDate'));
if($icpar->get('maxReg')) $this->addOption('maxReg', $icpar->get('maxReg'));
if($icpar->get('regEmailUser')) $this->addOption('regEmailUser', $icpar->get('regEmailUser'));
if($icpar->get('emailUserSubjectPeriod')) $this->addOption('emailUserSubjectPeriod', $icpar->get('emailUserSubjectPeriod'));
if($icpar->get('emailUserBodyPeriod')) $this->addOption('emailUserBodyPeriod', $icpar->get('emailUserBodyPeriod'));
if($icpar->get('emailUserSubjectDate')) $this->addOption('emailUserSubjectDate', $icpar->get('emailUserSubjectDate'));
if($icpar->get('emailUserBodyDate')) $this->addOption('emailUserBodyDate', $icpar->get('emailUserBodyDate'));
if($icpar->get('headerList')) $this->addOption('headerList', $icpar->get('headerList'));
// Struture
$structure = array(
// 'container'=>array(
// 'header'=>'',
// 'navigator'=>'',
// ),
'items' => array(
'item' => array(
'accessReg'=>'',
'approval'=>'',
'eventAllDates'=>'',
'eventHasPeriod'=>'',
'evtParams'=>'',
'infoDetails'=>'',
'statutReg'=>'',
'titleFormat'=>'',
'BackArrow'=>'',
'BackURL'=>'',
'id'=>'',
'Itemid'=>'',
'metaTitle'=>'',
'metaDesc'=>'',
'metaAsShortDesc'=>'',
'state'=>'',
'weekday'=>'',
'weekdayShort'=>'',
'timeformat'=>'',
'participantList'=>'',
'participantSlide'=>'',
'participantDisplay'=>'',
'fullListColumns'=>'',
'participantListTitle'=>'',
'arrowtext'=>'',
'navposition'=>'',
'headerList'=>'',
'title'=>'',
'titlebar'=>'',
'ManagerIcons'=>'',
'url'=>NULL,
'Event_Link'=>'',
'cat_id'=>'',
'cat_title'=>'',
'cat_color'=>'',
'fontColor'=>'',
'cat_desc'=>'',
'shortdesc'=>'',
'desc'=>'',
'shortDescription'=>'',
'description'=>'',
'descShort'=>'',
'image'=>'',
'imageTag'=>'',
'file'=>'',
'fileTag'=>'',
'displaytime'=>'',
'next'=>'',
'nextDate'=>'',
'period'=>'',
'startdatetime'=>'',
'enddatetime'=>'',
'nextControl'=>'',
'start_datetime'=>'',
'end_datetime'=>'',
'dates'=>'',
'startDate'=>'',
'startDay'=>'',
'endDate'=>'',
'endDay'=>'',
'endMonth'=>'',
'endMonthNum'=>'',
'endYear'=>'',
'startTime'=>'',
'endTime'=>'',
'periodDates'=>'',
'dateText'=>'',
'periodDisplay'=>'',
'periodControl'=>'',
'weekdays'=>'',
'day'=>'',
'maxNbTickets'=>'',
'ticketsCouldBeBooked'=>'',
'registeredForThisDate'=>'',
'maxReg'=>'',
'maxRlist'=>'',
'emailRequired'=>'',
'phoneRequired'=>'',
'month'=>'',
'monthNum'=>'',
'year'=>'',
'yearShort'=>'',
'evenTime'=>'',
'dateFormat'=>'',
'datelistMkt'=>'',
'datelist'=>'',
'datelistUl'=>'',
'time'=>'',
'address'=>'',
'name'=>'',
'email'=>'',
'contact_name'=>'',
'contact_email'=>'',
'emailLink'=>'',
'phone'=>'',
'website'=>'',
'websiteLink'=>'',
'targetLink'=>'',
'place_name'=>'',
'place_desc'=>'',
'city'=>'',
'country'=>'',
'coordinate'=>'',
'lat'=>'',
'lng'=>'',
'map'=>'',
'share'=>'',
'share_event'=>'',
'limitRegEmail'=>'',
'limitRegDate'=>'',
'gcalendarUrl'=>'',
'yahoocalendarUrl'=>'',
'wlivecalendarUrl'=>'',
'registrations'=>'',
'registered'=>'',
'totalRegistered'=>'',
'registeredUsers'=>'',
'reg'=>'',
'regUrl'=>'',
'iCagendaRegForm'=>'',
'typeReg'=>'',
'regEmailUser'=>'',
'emailUserSubjectPeriod'=>'',
'emailUserBodyPeriod'=>'',
'emailUserSubjectDate'=>'',
'emailUserBodyDate'=>'',
'language'=>'',
'params'=>'',
'gcalendarLink'=>'',
'loadEventCustomFields'=>'',
'features'=>'',
'periodTest'=>'', // DEPRECATED
'titleLink'=>'', // DEPRECATED
// REMOVED 3.5.3 'placeLeft'=>'',
)
)
);
return $this->getItems($structure);
}
/**
* Get Records.
*
* @return object list.
* @since 3.3.8
*/
public function getRecords()
{
// Get the current user for authorisation checks
$user = JFactory::getUser();
// Get Params for current view
$app = JFactory::getApplication();
$params = $app->getParams();
// Select the required fields from the table.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select('e.*')
->from($db->qn('#__icagenda_events') . ' AS e');
// Join over the language
$query->select('l.title AS language_title')
->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = e.language');
// Join over the users for the checked out user.
// $query->select('uc.name AS editor');
// $query->join('LEFT', '#__users AS uc ON uc.id=e.checked_out');
// Join over the asset groups.
$query->select('ag.title AS access_level')
->join('LEFT', '#__viewlevels AS ag ON ag.id = e.access');
// Join the category
$query->select('c.title AS category, c.color AS catcolor');
$query->join('LEFT', '#__icagenda_category AS c ON c.id = e.catid');
$query->where('c.state = 1');
// Join over the users for the author.
// $query->select('ua.name AS author_name, ua.username AS author_username')
// ->join('LEFT', '#__users AS ua ON ua.id = e.created_by');
// Filter by published state
$query->where('e.state = 1');
// Event is approved
$query->where('e.approval <> 1');
// Filter by access level.
$access_levels = implode(',', $user->getAuthorisedViewLevels());
$query->where('e.access IN (' . $db->q($access_levels) . ')');
// ->where('c.access IN (' . $db->q($access_levels) . ')'); // To be added later, when access integrated to category
// Filter by language
$query->where('e.language in (' . $db->q(JFactory::getLanguage()->getTag()) . ',' . $db->q('*') . ')');
// Filter by Features
$query->where(icagendaEventsData::getFeaturesFilter());
// Filter by dates
$dates_filter = $params->get('time', 1); // Default Current and Upcoming Events
// Get today date and datetime based on Joomla Config Timezone.
$datetime_today = JHtml::date('now', 'Y-m-d H:i:s');
$date_today = JHtml::date('now', 'Y-m-d');
if (!empty($dates_filter))
{
// COM_ICAGENDA_OPTION_TODAY_AND_UPCOMING
if ($dates_filter == '1')
{
$where_current_upcoming = $db->qn('e.next') . ' >= ' . $db->q($date_today);
$where_current_upcoming.= ' OR (' . $db->qn('e.next') . ' < ' . $db->q($datetime_today) . ' AND ' . $db->qn('e.startdate') . ' <> "0000-00-00 00:00:00" AND ' . $db->qn('e.enddate') . ' > ' . $db->q($datetime_today) . ')';
$query->where($where_current_upcoming);
}
// COM_ICAGENDA_OPTION_PAST
elseif ($dates_filter == '2')
{
$where_past = '(';
// Period dates with no weekdays filter
$where_past.= $db->qn('e.next') . ' < ' . $db->q($datetime_today) . ')';
$where_past.= ' AND (' . $db->qn('e.enddate') . ' < ' . $db->q($datetime_today);
$where_past.= ' )';
$query->where($where_past);
}
// COM_ICAGENDA_OPTION_FUTURE
elseif ($dates_filter == '3')
{
$where_upcoming = '(';
$where_upcoming.= $db->qn('e.next') . ' > ' . $db->q($datetime_today);
$where_upcoming.= ' )';
$query->where($where_upcoming);
}
// COM_ICAGENDA_OPTION_TODAY
elseif ($dates_filter == '4')
{
$where_today = '( ';
// One day dates filter
$where_today.= ' (';
$where_today.= ' (' . $db->qn('e.next') . ' >= ' . $db->q($datetime_today) . ')';
$where_today.= ' AND (' . $db->qn('e.next') . ' < ' . $db->q($date_today) . ' + INTERVAL 1 DAY)';
$where_today.= ' )';
// Period dates with no weekdays filter
$where_today.= ' OR ( ';
$where_today.= ' (' . $db->qn('e.next') . ' > ' . $db->q($date_today) . ')';
$where_today.= ' AND (' . $db->qn('e.weekdays') . ' = "")';
$where_today.= ' AND ' . $db->qn('e.enddate') . ' <> "0000-00-00 00:00:00" AND (' . $db->qn('e.enddate') . ' >= ' . $db->q($date_today) . ')';
$where_today.= ' AND ' . $db->qn('e.startdate') . ' <> "0000-00-00 00:00:00" AND (' . $db->qn('e.startdate') . ' < ' . $db->q($date_today) . ')';
$where_today.= ' )';
$where_today.= ' )';
$query->where($where_today);
}
}
// Order Next Date DESC
$orderby = $params->get('orderby', 2); // Default ASC
$ordering = ($orderby == 1) ? 'DESC' : 'ASC';
$query->order('e.next ' . $ordering);
// Tell the database connector what query to run.
$db->setQuery($query);
// Invoke the query or data retrieval helper.
$db_list = $db->loadObjectList();
return $db_list;
}
/**
* Load Google Maps Scripts.
*
* @since 3.5.0
*/
public static function loadGMapScripts()
{
// Google Maps api V3
$document = JFactory::getDocument();
$scripts = array_keys($document->_scripts);
$mapsgooglescriptFound = false;
for ($i = 0; $i < count($scripts); $i++)
{
if ( stripos($scripts[$i], 'maps.googleapis.com') !== false
&& stripos($scripts[$i], 'maps.gstatic.com') !== false )
{
$mapsgooglescriptFound = true;
}
}
$doclang = JFactory::getDocument();
$curlang = $doclang->language;
$lang = substr($curlang, 0, 2);
if (!$mapsgooglescriptFound)
{
$document->addScript('https://maps.googleapis.com/maps/api/js?sensor=false&librairies=places&language=' . $lang);
}
JHtml::script( 'com_icagenda/icmap-front.js', false, true );
}
/**
* Get the return URL.
*
* @return string The return URL.
* @since 1.0
*/
public function getReturnPage()
{
return base64_encode($this->getState('return_page'));
}
}
home/wuectly/www/libraries/f0f/form/field/list.php 0000604 00000023322 15245667523 0016172 0 ustar 00 <?php
/**
* @package FrameworkOnFramework
* @subpackage form
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('F0F_INCLUDED') or die;
JFormHelper::loadFieldClass('list');
/**
* Form Field class for F0F
* Supports a generic list of options.
*
* @package FrameworkOnFramework
* @since 2.0
*/
class F0FFormFieldList extends JFormFieldList implements F0FFormField
{
protected $static;
protected $repeatable;
/** @var F0FTable The item being rendered in a repeatable form field */
public $item;
/** @var int A monotonically increasing number, denoting the row number in a repeatable view */
public $rowid;
/**
* Method to get certain otherwise inaccessible properties from the form field object.
*
* @param string $name The property name for which to the the value.
*
* @return mixed The property value or null.
*
* @since 2.0
*/
public function __get($name)
{
switch ($name)
{
case 'static':
if (empty($this->static))
{
$this->static = $this->getStatic();
}
return $this->static;
break;
case 'repeatable':
if (empty($this->repeatable))
{
$this->repeatable = $this->getRepeatable();
}
return $this->repeatable;
break;
default:
return parent::__get($name);
}
}
/**
* 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 F0FTable))
{
$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 F0F 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');
F0FUtilsArray::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 = F0FTemplateUtils::parsePath($source_file, true);
if (F0FPlatform::getInstance()->getIntegrationObject('filesystem')->fileExists($source_file))
{
include_once $source_file;
}
}
// Make sure the class exists
if (class_exists($source_class, true))
{
// ...and so does the option
if (in_array($source_method, get_class_methods($source_class)))
{
// Get the data from the class
if ($source_format == 'optionsobject')
{
$options = array_merge($options, $source_class::$source_method());
}
else
{
// 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;
}
}
home/wuectly/www/libraries/joomla/form/fields/list.php 0000604 00000016417 15245673005 0017162 0 ustar 00 <?php
/**
* @package Joomla.Platform
* @subpackage Form
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* Form Field class for the Joomla Platform.
* Supports a generic list of options.
*
* @since 1.7.0
*/
class JFormFieldList extends JFormField
{
/**
* The form field type.
*
* @var string
* @since 1.7.0
*/
protected $type = 'List';
/**
* Method to get the field input markup for a generic list.
* Use the multiple attribute to enable multiselect.
*
* @return string The field input markup.
*
* @since 3.7.0
*/
protected function getInput()
{
$html = array();
$attr = '';
// Initialize some field attributes.
$attr .= !empty($this->class) ? ' class="' . $this->class . '"' : '';
$attr .= !empty($this->size) ? ' size="' . $this->size . '"' : '';
$attr .= $this->multiple ? ' multiple' : '';
$attr .= $this->required ? ' required aria-required="true"' : '';
$attr .= $this->autofocus ? ' autofocus' : '';
// To avoid user's confusion, readonly="true" should imply disabled="true".
if ((string) $this->readonly == '1' || (string) $this->readonly == 'true' || (string) $this->disabled == '1'|| (string) $this->disabled == 'true')
{
$attr .= ' disabled="disabled"';
}
// Initialize JavaScript field attributes.
$attr .= $this->onchange ? ' onchange="' . $this->onchange . '"' : '';
// Get the field options.
$options = (array) $this->getOptions();
// Create a read-only list (no name) with hidden input(s) to store the value(s).
if ((string) $this->readonly == '1' || (string) $this->readonly == 'true')
{
$html[] = JHtml::_('select.genericlist', $options, '', trim($attr), 'value', 'text', $this->value, $this->id);
// E.g. form field type tag sends $this->value as array
if ($this->multiple && is_array($this->value))
{
if (!count($this->value))
{
$this->value[] = '';
}
foreach ($this->value as $value)
{
$html[] = '<input type="hidden" name="' . $this->name . '" value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"/>';
}
}
else
{
$html[] = '<input type="hidden" name="' . $this->name . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"/>';
}
}
else
// Create a regular list passing the arguments in an array.
{
$listoptions = array();
$listoptions['option.key'] = 'value';
$listoptions['option.text'] = 'text';
$listoptions['list.select'] = $this->value;
$listoptions['id'] = $this->id;
$listoptions['list.translate'] = false;
$listoptions['option.attr'] = 'optionattr';
$listoptions['list.attr'] = trim($attr);
$html[] = JHtml::_('select.genericlist', $options, $this->name, $listoptions);
}
return implode($html);
}
/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 3.7.0
*/
protected function getOptions()
{
$fieldname = preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname);
$options = array();
foreach ($this->element->xpath('option') as $option)
{
// Filter requirements
if ($requires = explode(',', (string) $option['requires']))
{
// Requires multilanguage
if (in_array('multilanguage', $requires) && !JLanguageMultilang::isEnabled())
{
continue;
}
// Requires associations
if (in_array('associations', $requires) && !JLanguageAssociations::isEnabled())
{
continue;
}
// Requires adminlanguage
if (in_array('adminlanguage', $requires) && !JModuleHelper::isAdminMultilang())
{
continue;
}
// Requires vote plugin
if (in_array('vote', $requires) && !JPluginHelper::isEnabled('content', 'vote'))
{
continue;
}
}
$value = (string) $option['value'];
$text = trim((string) $option) != '' ? trim((string) $option) : $value;
$disabled = (string) $option['disabled'];
$disabled = ($disabled == 'true' || $disabled == 'disabled' || $disabled == '1');
$disabled = $disabled || ($this->readonly && $value != $this->value);
$checked = (string) $option['checked'];
$checked = ($checked == 'true' || $checked == 'checked' || $checked == '1');
$selected = (string) $option['selected'];
$selected = ($selected == 'true' || $selected == 'selected' || $selected == '1');
$tmp = array(
'value' => $value,
'text' => JText::alt($text, $fieldname),
'disable' => $disabled,
'class' => (string) $option['class'],
'selected' => ($checked || $selected),
'checked' => ($checked || $selected),
);
// Set some event handler attributes. But really, should be using unobtrusive js.
$tmp['onclick'] = (string) $option['onclick'];
$tmp['onchange'] = (string) $option['onchange'];
if ((string) $option['showon'])
{
$tmp['optionattr'] = " data-showon='" .
json_encode(
JFormHelper::parseShowOnConditions((string) $option['showon'], $this->formControl, $this->group)
)
. "'";
}
// Add the option object to the result set.
$options[] = (object) $tmp;
}
if ($this->element['useglobal'])
{
$tmp = new stdClass;
$tmp->value = '';
$tmp->text = JText::_('JGLOBAL_USE_GLOBAL');
$component = JFactory::getApplication()->input->getCmd('option');
// Get correct component for menu items
if ($component == 'com_menus')
{
$link = $this->form->getData()->get('link');
$uri = new JUri($link);
$component = $uri->getVar('option', 'com_menus');
}
$params = JComponentHelper::getParams($component);
$value = $params->get($this->fieldname);
// Try with global configuration
if (is_null($value))
{
$value = JFactory::getConfig()->get($this->fieldname);
}
// Try with menu configuration
if (is_null($value) && JFactory::getApplication()->input->getCmd('option') == 'com_menus')
{
$value = JComponentHelper::getParams('com_menus')->get($this->fieldname);
}
if (!is_null($value))
{
$value = (string) $value;
foreach ($options as $option)
{
if ($option->value === $value)
{
$value = $option->text;
break;
}
}
$tmp->text = JText::sprintf('JGLOBAL_USE_GLOBAL_VALUE', $value);
}
array_unshift($options, $tmp);
}
reset($options);
return $options;
}
/**
* Method to add an option to the list field.
*
* @param string $text Text/Language variable of the option.
* @param array $attributes Array of attributes ('name' => 'value' format)
*
* @return JFormFieldList For chaining.
*
* @since 3.7.0
*/
public function addOption($text, $attributes = array())
{
if ($text && $this->element instanceof SimpleXMLElement)
{
$child = $this->element->addChild('option', $text);
foreach ($attributes as $name => $value)
{
$child->addAttribute($name, $value);
}
}
return $this;
}
/**
* Method to get certain otherwise inaccessible properties from the form field object.
*
* @param string $name The property name for which to get the value.
*
* @return mixed The property value or null.
*
* @since 3.7.0
*/
public function __get($name)
{
if ($name == 'options')
{
return $this->getOptions();
}
return parent::__get($name);
}
}
home/wuectly/www/administrator/components/com_media/models/list.php 0000604 00000012701 15245725462 0021756 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
/**
* Media Component List Model
*
* @since 1.5
*/
class MediaModelList extends JModelLegacy
{
/**
* Method to get model state variables
*
* @param string $property Optional parameter name
* @param mixed $default Optional default value
*
* @return object The property where specified, the state object where omitted
*
* @since 1.5
*/
public function getState($property = null, $default = null)
{
static $set;
if (!$set)
{
$input = JFactory::getApplication()->input;
$folder = $input->get('folder', '', 'path');
$this->setState('folder', $folder);
$parent = str_replace("\\", '/', dirname($folder));
$parent = ($parent == '.') ? null : $parent;
$this->setState('parent', $parent);
$set = true;
}
return parent::getState($property, $default);
}
/**
* Get the images on the current folder
*
* @return array
*
* @since 1.5
*/
public function getImages()
{
$list = $this->getList();
return $list['images'];
}
/**
* Get the folders on the current folder
*
* @return array
*
* @since 1.5
*/
public function getFolders()
{
$list = $this->getList();
return $list['folders'];
}
/**
* Get the documents on the current folder
*
* @return array
*
* @since 1.5
*/
public function getDocuments()
{
$list = $this->getList();
return $list['docs'];
}
/**
* Build imagelist
*
* @return array
*
* @since 1.5
*/
public function getList()
{
static $list;
// Only process the list once per request
if (is_array($list))
{
return $list;
}
// Get current path from request
$current = (string) $this->getState('folder');
$basePath = COM_MEDIA_BASE . ((strlen($current) > 0) ? '/' . $current : '');
$mediaBase = str_replace(DIRECTORY_SEPARATOR, '/', COM_MEDIA_BASE . '/');
// Reset base path
if (strpos(realpath($basePath), JPath::clean(realpath(COM_MEDIA_BASE))) !== 0)
{
$basePath = COM_MEDIA_BASE;
}
$images = array ();
$folders = array ();
$docs = array ();
$videos = array ();
$fileList = false;
$folderList = false;
if (file_exists($basePath))
{
// Get the list of files and folders from the given folder
$fileList = JFolder::files($basePath);
$folderList = JFolder::folders($basePath);
}
// Iterate over the files if they exist
if ($fileList !== false)
{
$tmpBaseObject = new JObject;
foreach ($fileList as $file)
{
if (is_file($basePath . '/' . $file) && substr($file, 0, 1) != '.' && strtolower($file) !== 'index.html')
{
$tmp = clone $tmpBaseObject;
$tmp->name = $file;
$tmp->title = $file;
$tmp->path = str_replace(DIRECTORY_SEPARATOR, '/', JPath::clean($basePath . '/' . $file));
$tmp->path_relative = str_replace($mediaBase, '', $tmp->path);
$tmp->size = filesize($tmp->path);
$ext = strtolower(JFile::getExt($file));
switch ($ext)
{
// Image
case 'jpg':
case 'png':
case 'gif':
case 'xcf':
case 'odg':
case 'bmp':
case 'jpeg':
case 'ico':
$info = @getimagesize($tmp->path);
$tmp->width = @$info[0];
$tmp->height = @$info[1];
$tmp->type = @$info[2];
$tmp->mime = @$info['mime'];
if (($info[0] > 60) || ($info[1] > 60))
{
$dimensions = MediaHelper::imageResize($info[0], $info[1], 60);
$tmp->width_60 = $dimensions[0];
$tmp->height_60 = $dimensions[1];
}
else
{
$tmp->width_60 = $tmp->width;
$tmp->height_60 = $tmp->height;
}
if (($info[0] > 16) || ($info[1] > 16))
{
$dimensions = MediaHelper::imageResize($info[0], $info[1], 16);
$tmp->width_16 = $dimensions[0];
$tmp->height_16 = $dimensions[1];
}
else
{
$tmp->width_16 = $tmp->width;
$tmp->height_16 = $tmp->height;
}
$images[] = $tmp;
break;
// Video
case 'mp4':
$tmp->icon_32 = 'media/mime-icon-32/' . $ext . '.png';
$tmp->icon_16 = 'media/mime-icon-16/' . $ext . '.png';
$videos[] = $tmp;
break;
// Non-image document
default:
$tmp->icon_32 = 'media/mime-icon-32/' . $ext . '.png';
$tmp->icon_16 = 'media/mime-icon-16/' . $ext . '.png';
$docs[] = $tmp;
break;
}
}
}
}
// Iterate over the folders if they exist
if ($folderList !== false)
{
$tmpBaseObject = new JObject;
foreach ($folderList as $folder)
{
$tmp = clone $tmpBaseObject;
$tmp->name = basename($folder);
$tmp->path = str_replace(DIRECTORY_SEPARATOR, '/', JPath::clean($basePath . '/' . $folder));
$tmp->path_relative = str_replace($mediaBase, '', $tmp->path);
$count = MediaHelper::countFiles($tmp->path);
$tmp->files = $count[0];
$tmp->folders = $count[1];
$folders[] = $tmp;
}
}
$list = array('folders' => $folders, 'docs' => $docs, 'images' => $images, 'videos' => $videos);
return $list;
}
/**
* Get the videos on the current folder
*
* @return array
*
* @since 3.5
*/
public function getVideos()
{
$list = $this->getList();
return $list['videos'];
}
}
home/wuectly/www/layouts/joomla/searchtools/default/list.php 0000604 00000001136 15245737577 0020456 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$data = $displayData;
// Load the form list fields
$list = $data['view']->filterForm->getGroup('list');
?>
<?php if ($list) : ?>
<div class="ordering-select hidden-phone">
<?php foreach ($list as $fieldName => $field) : ?>
<div class="js-stools-field-list">
<?php echo $field->input; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>